[ANSI-Smalltalk] Smalltalk file streams

Paolo Bonzini bonzini at gnu.org
Fri Oct 17 06:34:15 BST 2008


>>>    There appears to be a tacit assumption that
>>>    one internal character = one external byte.
>>
>> No, there's no such assumption.  It's just that file streams do not hide
>> that the underlying storage is bytes, not character.
> 
> Perhaps this is the way file streams *should* be,
> it it is certain a misrepresentation of the ANSI standard.

So we agree. :-)

> CONSIDERING the issue is timely, whatever the outcome.
> Deciding to position socket streams somewhere in the hierarchy
> where #position and #position: do not exist is an excellent
> idea.  That means, "not below <sequencedStream>".  However,
> <sequencedStream> is where #close lives, and sockets want that.

I think that both #close and #flush should live in <Stream>, possibly as
no-ops.  Most implementations do that.

> This leaves the issue of /dev/tty, ptys, /dev/[u]random, a whole
> bunch of things in /proc, and so on, exactly where they stood
> before: you can open then using FileStream, you can read from
> them, but they have operations in their interface that they
> CANNOT implement.  There needs to be a standard way to deal with
> this.

For something like #position, exceptions are the solution.  But if I ask
for the contents of /dev/urandom, I have a problem, the system should
not be responsible for me doing something insane.

Paolo



More information about the ANSI-Smalltalk mailing list