[BUG] ReadStream>>isEmpty ?

Andreas Raab andreas.raab at gmx.de
Fri Aug 8 16:53:08 UTC 2003


> Well there is the potential here for an interesting debate.

I don't see any. When you ask for #(1 2 3) readStream next you get 1 (just
as expected). I can't see why we would want #(1 2 3) readStream isEmpty ever
to answer true then.

> As it stands what is happening (conceptually) is that the stream
> is created empty and that the values are written to it and then 
> the stream is returned.

No, that's wrong. You are actually saying it yourself:

> | myStream |
>
> myStream _ #(1 2 3) readStream reset.
> myStream isEmpty
> 
> which returns true.

It answers _true_ after you reset it, e.g., the read stream claims to be
empty even though it will happily answer a value when you ask for the #next
element.

> Which is right?  *shrug*

Clearly, the current behavior of #isEmpty is wrong.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list