More on WriteStream>>on:

Klaus D. Witzel klaus.witzel at cobss.com
Wed Feb 14 21:31:34 UTC 2007


Hi Alan,

on Wed, 14 Feb 2007 22:06:16 +0100, you wrote:
> <Andreas>
> Buffer streaming. It is very handy to be able to share the underlying
> collection with a stream when you know what you are doing.
> <Andreas>
>
> Yes.  It would be even better to be able to do that wihout having to  
> know so
> much about what some other object might or might not do.
>
> Damien is right.  Either Streams should ensure their internal collections
> are unique to them,

Better not (assume anything about arguments passed in), see below.

> or they should assume that other objects have references
> to those collections, and might be expecting the stream to always be
> referencing the same collection.

Like for

  Smalltalk specialObjectsArray writeStream nextPutAll: {this. and. that}

> The second approach can be implemented
> using #become:.

Not always. See example above.

/Klaus

> --Alan
>
>




More information about the Squeak-dev mailing list