Roles of FileStream (was: Re: New SqueakMap)
Andreas Raab
andreas.raab at gmx.de
Wed Apr 12 22:03:24 UTC 2006
Yoshiki Ohshima wrote:
>> That FileStream oldFileNamed: 'xyz.gif' assumes that xyz.gif is a text
>> file of UFT-8 format looks to me like the principle of the biggest
>> surprise ;)
>
> Opening a .gif file as a text file with *any* encoding (including
> non-conversion latin1) is logically wrong anyway... So this example
> may not tell us anything^^;
It's actually funny for me to follow this discussion because it's at the
heart of why I think a separation of concerns is necessary. The way I
look at the above statements is that there is an implicitly different
assumption about what role "FileStream" has. Martin makes the (not
unreasonable) assumption that FileStream is a byte-oriented stream,
whereas Yoshiki makes the (equally reasonable) assumption that
FileStream is a character-oriented stream.
Who is right? If characters are bytes, both. If characters are not bytes
(I think) neither. We're living in a state of confusion these days
because historically FileStream has been used for both purposes and
we're now learning that when characters are no longer bytes we need to
be a little clearer about the roles.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|