On the validity of comments

Julian Fitzell julian at beta4.com
Fri Aug 8 21:57:46 UTC 2003


No, I think you're right.  I'd expect a method that just positions the 
cursor at a particular place to be called #on:positionAt: or something. 
  Or even #on:limitFrom:to:.  Any other method with "from:to:" in it 
actually selects those items out of the range to work with.

I can see both as possible semantics you might want - but the current 
behaviour doesn't map with the name of the method in my opinion.

Julian

Ken Causey wrote:
> 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?
>>
>>Ke
> 
> n
> 
> 
> ------------------------------------------------------------------------
> 
> 




More information about the Squeak-dev mailing list