More on WriteStream>>on:

Roel Wuyts Roel.Wuyts at ulb.ac.be
Wed Feb 14 22:19:04 UTC 2007


On 14 Feb 2007, at 14 February/19:14, Klaus D. Witzel wrote:

> Hi Roel,
>
> on Wed, 14 Feb 2007 18:47:05 +0100, you wrote:
>
>> Could somebody who likes the fact that WriteStream modifies the  
>> collection passed with #on: give me an actual example where this  
>> behaviour is actually desirable/useful (I am not talking about  
>> ReadStream here) ?
>>
>>
>> Otherwise put, why should we not change the implementation of #on:  
>> in Stream to do:
>>
>> on: aCollection
>
> I would be strongly against such a copy; also a condition like  
> (aCollection isString) would be way too much. The literal (which  
> people seem to believe is a constant, it is *not*, it's a *literal*  
> object) can only be decided by the *caller* to be constant. Besides  
> of that: performance ...
>
> Isn't #writeStream a very meaningful English wording? "caution, we  
> are the *writers*, we *write* when you ask for #writeStream".

Exactly. That is why the default behaviour could be to not destroy  
what I pass to it...
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.

>
> /Klaus
>
>> 	.... aCollection copy .....
>>
>>
>> --
>> Roel
>>
>>
>
>
>




More information about the Squeak-dev mailing list