Extending FileList with CrLf

Daniel Vainsencher danielv at netvision.net.il
Wed Jul 23 09:54:06 UTC 2003


Scripting languages do by default all sorts of things that other
languages require be specified. I think each is doing the right thing
for its niche, and I don't think Squeak should behave like a scripting
language in this matter. 

Note that I would be happy even if autodetection did exist, but had an
intention revealing name such as #smartFileNamed:. Then people would
have had fair warning about what is going on. What I am saying is that
the plain #fileNamed: and friends, should be plain, not smart.

In this scenario, all the functionalities would exist, and be easily
available but the surprises would be harder to come by.

Daniel

Ingo Hohmann <ingo at 2b1.de> wrote:
> 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