Extending FileList with CrLf
Ingo Hohmann
ingo at 2b1.de
Wed Jul 23 09:03:52 UTC 2003
Hi Daniel,
Daniel Vainsencher wrote:
> [In short - the default encoding should be platform consistent, not
> fixed]
> You think the OS is the platform, I think Squeak is the platform. Not a
> big difference. Could well be a preference, and I wouldn't care very
> much which was the default. Assuming that's all the change we're talking
> about.
>
> But this isn't what CrLfFS implements, because CrLf tries to be smart
> when reading files.
>
> Either way, for the reasons of consistency, if we use the OS convention
> it must be the policy for reading, as well as writing. Streams should
> not try to "detect" line endings. For streams that perform any
> conversion, reading characters that violate the initially assumed
> encoding, whatever it is, should bring up an exception.
I have some experience with Rebol, a language which works like:
- when reading in text mode, for whatever lineending there is in the
file, the internal representation will use lf as lineending
- when writing in text mode, lineendings will be written with the OS
default.
- if you don't want it this way, you may either use binary, or define
the lineendings yourself.
And I can only say, within the last 3 years there hasn't been a single
complaint about it, in fact, most people seem to enjoy it this way,
because it makes life a lot easier most of the time.
Kind regards,
Ingo
More information about the Squeak-dev
mailing list
|