On 2012-12-30 8:52 AM, Colin Putney wrote:


On Sat, Dec 29, 2012 at 12:30 PM, Chris Cunnington <smalltalktelevision@gmail.com> wrote:
I think I'm missing a simpler way. Especially with Xtreams. Shouldn't I just use a filter, change the #contentSpecies, or something?

Yeah, writing into an OrderedCollection with a stream is a bit suspect to begin with. Both provide a way to grow an underlying fix-size collection as you add more elements. If you have an OrderedCollection, you can just send #add:, no need for a write stream. If you want to build a string, "String new writing" will do the job, no need for an OrderedCollection. 

Also, you can write an OC full of characters directly into a write stream on a string:

chars := 'abc' asOrderedCollection.
String new writing 
write: '123';
write: chars; 
conclusion

Colin
Martin also made it look easier with a write than a read. I think I was looking at it the wrong way around. The OC shouldn't be the receiver but the argument. #writing into a String instead of #reading an OC.

Thanks,
Chris