Extending FileList with CrLf

Lex Spoon lex at cc.gatech.edu
Sun Aug 3 17:50:49 UTC 2003


I wish people would talk about the specific situation, because it cuts
through a lot of the difficult philosophy.  What exactly do people
expect to go wrong if CLFS is the default file stream?  Many things will
instantly get better, and I don't expect any new problems to arise.

Additionally, I wish people would stop talking about major redesigns of
the File* classes.  No one is volunteering to implement any such thing
and thus it is distracting.  What is on the table right now is a
proposal to put CLFS in as the standard file stream class.  That is a
tiny thing that I among many others would be happy to implement.


Now, let me try to bring some philosophy back down to the particular
situation:



Colin Putney <cputney at wiresong.ca> wrote:
> I wouldn't want or expect  that policy to be implemented by a general-purpose FileStream.

That is regrettable, but other people expect the opposite.  Thus there
is no way to put this functionality in the place everyone thinks it
should be at.


> In a monolithic system, it makes sense to put "smarts" into the stream 
> classes. After all, you've got all the users of those classes handy, 
> and cmd-n will tell you everything that needs to be accommodated by the 
> policy.

Actually, many existing low level libraries already want "smart"
end-of-line translation.  Furthermore, the way they are written right
now, the smart translation does have to be directly in the standard file
stream class, because they get the behavior by sending #text to the file
object (or indeed using the default, which is text mode).



> But a library shouldn't try to be smarter than the application that 
> uses it. And yes, I know that the smarts can be turned off. But I agree 
> with Daniel that the errors caused by inappropriate cleverness are 
> worse than those caused by lack of cleverness. 

In this particular case, consider two things.  First, it is also an
error *not* to turn on the smarts when they are needed.  Second, an
error in the setting is easy to debug.  We are just talking about
end-of-line translation here.  If you don't want it and you get it, then
you'll surely notice.  If you do want it and you don't get it, you'll
also notice.  The only time you don't notice if you are working on a Mac
and both behaviors are the same, but this difficulty is inherent to
working on a Mac; it exists no matter whether CLFS is default


Overall, if you look at the specific case, I don't think there are any
problems that have been unearthed.  Let's put CLFS as the default.

Lex



More information about the Squeak-dev mailing list