WriteStream nextPutAll: fails with OrderedCollection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

WriteStream nextPutAll: fails with OrderedCollection

bgridley-2
Try this code:

          WriteStream on: OrderedCollection new) nextPutAll: 'Fails in at:put: method'



#nextPutAll: sends the method #replaceFrom:to:with:startingAt: to whatever collection it uses.  Unfortunately in this case, OrderedCollection does not reset its #lastIndex appropriately in this method, so it hits the error condition.

Given that #nextPutAll: works as expected when applied to a WriteStream with an empty String for a collection,  It should also work for an empty OrderedCollection.  My opinion is that #nextPutAll: should be calling a different method than #replaceFrom:to:with:startingAt: - perhaps #replaceFrom:to:with:startingAt:extend: where the last argument is a boolean which determines whether a strict replacement is observed or a collection may be extended. (In which case #nextPutAll: would send #true for this attribute.)

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.