More on WriteStream>>on:

Roel Wuyts Roel.Wuyts at ulb.ac.be
Wed Feb 14 22:57:23 UTC 2007


>> Exactly. That is why the default behaviour could be to not destroy  
>> what I pass to it...
>
> Well, this "destroy" *is* subjective :) OTOH, typical example:
>
> 	out := WriteStream
> 				on: (String new: 1000).
>
> Of the 312 users of WriteStream in the current Squeak-dev .image,  
> do you happen to know an example which does *not* pass a freshly  
> instantiated+completely unused (alternately: an empty one like '')  
> subinstance of ArrayedCollection?

Well, in the current implementation they have to do this or you could  
be in trouble :-) :-)

But thanks, via a detour, for answering part of my question: I do not  
think that there are many usages of the fact that data is shared  
between two WriteStream instances. So then you could opt to make that  
the default behaviour. And have a version besides it for people (like  
Andreas) that know what they are doing. Or provide some more class  
methods to create the streams or something. Personally I do not mind  
that much: I am conditioned to not pass in String instances just like  
that.

Note, as I wrote in one of the other mails, that the system should at  
least become consistent (the problem with the collections growing and  
therefore being copied).

>> But I was actually asking for real examples where the fact that  
>> the usage of one WriteStream has a side-effect on another  
>> WriteStream is useful.
>
> I don't load all the packages and investigate them only to answer  
> what you can answer yourself, if that'd be what you mean.

:-) I did not expect (or anybody) to do this :-) Just whether offhand  
people could come up with one real example of two WriteStream's  
sharing a collection and depending on it changing. Note that this is  
actually quite hard to find in the code.

> Perhaps other people have some experience?
>
> /Klaus
>
>>>
>>> /Klaus
>>>
>>>> 	.... aCollection copy .....
>>>>
>>>>
>>>> --
>>>> Roel
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>




More information about the Squeak-dev mailing list