[squeak-dev] Re: squeak XTream

Andreas Raab andreas.raab at gmx.de
Wed Dec 2 05:55:25 UTC 2009

Hi Nicolas -

I suppose it's too tempting to write a new stream library rather than 
just speeding up the existing files ;-) I like the basic approach 
although adoption will be a tad more difficult than just having a faster 
version of FileStream.

> The stream stacking/piping/composing/transforming (choose a name) is
> based on major XTream idea that stream should be transformed through a
> block taking an :inputStream and an :outputStream arguments.
> This enables virtually any processing (like inflating deflating
> encoding decoding etc...)

Fair enough as a general architecture but there really, really should be 
a way of stacking up things directly, i.e., along the lines of:

file := FileHandle open: 'file.txt' mode: 'rb'.
stream := UTF8EncodingXTream on: BufferedXtream on: FileXtream on: file.

I would't want to write this using blocks as input and output.

> Other noticeable point:
> I avoided EndOfStream notification and replaced by an
> endOfStreamAction instance variable, which is quite fun.

Interesting idea. I'm not sure if this is feasible in the long-term 
though because writing code for pieces "in the middle" will be tricky if 
you don't know whether you're being fed with an exception or not.

> I will concentrate now on providing basic collection functionalities.
> Then basic file functionalities, probably starting with a
> StandardFileStream as source, then a IOFileHandle maybe.
> - buffered read/write (equivalent to StandardFileStream)
> - line end conversions (equivalent to CrLfFileStream)
> - encoding conversions via transform: operations (equivalent to
> MultiByteFileStream)

Well, I'm still in the business of shopping for a faster version of 
FileStream ;-)

   - Andreas

More information about the Squeak-dev mailing list