EndOfStream unused

Jason Johnson jason.johnson.081 at gmail.com
Thu Nov 8 17:37:59 UTC 2007

Why would it kill performance?  The block is created at the first
call, and thereafter a reference to it is past, no?  That sounds
pretty fast to me.

I don't think Smalltalk people have a hard time thinking outside the
box, I think rather they like flexibility and don't always concern
themselves by the dead ends other systems pursue. :)  Certainly not to
say exceptions are a dead end, just that having a choice when possible
is nice.

On Nov 8, 2007 6:22 PM, Paolo Bonzini <bonzini at gnu.org> wrote:
> > Stream>>next
> >   ^ self nextIfAtEnd: [ ^ nil ]
> >
> > Stream>>nextIfAtEnd: anEndBlock
> If you don't care about the cost of creating a block (and on "real"
> closure implementations blocks that return are the most expensive ones),
> you will just use #do:.  This will kill performance 100 times more than
> an EndOfStream notification.
> Smalltalk people sometimes seem to be allergic to thinking out of the
> box.  #at:ifAbsent:-like things have a place, exception handling has a
> similar but different place.  Nobody is proposing to have millions of
> exceptions as in Java.
> Paolo

More information about the Squeak-dev mailing list