BUG with OrderedCollection new writeStream ?

Paolo Bonzini bonzini at gnu.org
Fri Sep 21 05:16:34 UTC 2007


nicolas cellier wrote:
> Paolo Bonzini a écrit :
>> Damien Pollet wrote:
>>> foo := OrderedCollection new writeStream.
>>> foo nextPut: 42. "Say hello to the debugger"
>>
>> The #writeStream method is in practice usable only for 
>> ArrayedCollections; Glorp for example uses an AddingWriteStream which 
>> is little more than an adaptor (#contents returns the collection, 
>> #nextPut: uses #addAll:).  I'm curious, how does Nile solve this problem?
>>
>> Paolo
> 
> VW solved the problem too, they use a message (collection growTo: 
> newSize) or something like that instead of (collection class new: newSize).

I've wondered though if it's necessary.  The adapter solution is better 
in my humble opinion, because it is stupid that the stream imposes a 
growing policy to a growing collection, and because an "adding stream" 
would not need a final copy when calling #contents.

Paolo



More information about the Squeak-dev mailing list