EndOfStream unused

nicolas cellier ncellier at ifrance.com
Tue Nov 6 22:05:58 UTC 2007


EndOfStream Exception seems to be unused in 3.10

My understanding was that:

   [[aStream next doSomething] repeat]
   	on: EndOfStream do: [:exc | exc return: nil].

would be more efficient than testing atEnd at each loop:
(would only the EndOfStream be signalled!)

   [aStream atEnd]
   	whileFalse: [aStream next doSomething].

Especially, I have stream wrappers (to select:) with costly atEnd test!
Maybe isNil test is efficient but I want to be able to stream on nil!

   | nxt |
   [nxt := aStream next.
   nxt == nil]
   	whileFalse: [aStream next doSomething].

Am I all wrong?
What do you think?

Nicolas




More information about the Squeak-dev mailing list