| input input2|
input := Array streamContents: [ :lines |
'input.txt' asFileReference readStreamDo: [ :in |
[ in atEnd ] whileFalse: [ lines nextPut: in nextLine ]]].
input inject: 0 into: [ :sum :each | each asInteger + sum ]
is there a way I can improve this code for example do the counting in the stream ?
Roelof