>>822
Stella の SECONDL の例を Squeak/Pharo Smalltalk のストリームを使って書いてみました。
参考まで。

| SECONDL IN OUT |

SECONDL := [:INPUT :OUTPUT |
 | FIRSTL S1 S2 S3 |

 FIRSTL := [:INS :MAX :OTHERS |
  | I LASTMAX |
  (LASTMAX := INS next) ifNil: [self error: 'empty stream'].
  [INS atEnd] whileFalse: [
   (I := INS next) > LASTMAX ifTrue: [I := LASTMAX flag: (LASTMAX := I)].
   OTHERS nextPut: I].
  MAX nextPut: LASTMAX].

 S1 := INPUT.
 S2 := ReadWriteStream on: IntegerArray new.
 S3 := OUTPUT.

 FIRSTL value: S1 value: NullStream new value: S2.
 FIRSTL value: S2 reset value: S3 value: NullStream new
].

IN := #(54 16 1 58 93 57 84 72 32 25) asIntegerArray readStream.
OUT := ReadWriteStream on: IntegerArray new.
SECONDL value: IN value: OUT.
OUT reset next "=> 84 "