On the validity of comments
Ken Causey
ken at kencausey.com
Fri Aug 8 19:45:50 UTC 2003
After talking to Brian Rice I've come to the conclusion that I've been
overlooking the meaning of "on" and have been thinking of it as
something more akin to "newFrom" or "copy". So maybe the comment needs
to be fixed more than the implementation.
However I'm wondering about the problem with reset. What if the user of
such a stream wanted to iterate over the stream more than once. Would
she not expect to be able to use reset and get back to the position
specified for from: and not back to the start of the original
collection?
Ken
On Fri, 2003-08-08 at 13:25, Ken Causey wrote:
> WriteStream class>>on:from:to
>
> "Answer an instance of me on a copy of the argument, aCollection,
> determined by the indices firstIndex and lastIndex. Position the
> instance at the beginning of the collection."
>
> In reality the collection is neither copied nor is the position set to
> the beginning of the collection.
>
> a _ #(1 2 3 4 5).
> (ReadWriteStream on: a from: 2 to: 4) reset nextPut: 5.
> a
>
> print-it on all that and you get back #(5 2 3 4 5).
>
> Do users of such a WriteStream really expect their original collection
> to be overwritten?
>
> Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030808/5f34665d/attachment.pgp
More information about the Squeak-dev
mailing list
|