3.9 Oddities

David T. Lewis lewis at mail.msen.com
Wed Sep 6 01:59:29 UTC 2006


On Mon, Sep 04, 2006 at 07:19:16PM -1000, Rich Warren wrote:
> 
> They seem so prevalent. I though they might be a difference in EOL  
> symbols between Win/Mac/Unix. Does squeak use a standard end of line  
> character? Or does it vary based on OS. Is there a way you can adjust  
> this setting, or automatically convert documents?

There is no such thing as a "standard end of line character". Certain
operating systems and file systems have adopted the convention of
treating <cr><lf>, <cr>, or <lf> as deliminators for file records,
while many other file systems have an actual concept of "record"
that does not require delimiters. Either way, there is no such thing
as a standard.

The convention (nothing more, nothing less) for Smalltalk systems
is to treat <cr> as a line terminator. This is "incompatible" with
Micosoft conventions in the same sense that (for example) Microsoft
line end conventions are "incompatible" with Unix systems and vice
versa.

All of these conventions date back to teletype hardware. The <cr>
means move the carriage to the full left stop position (hence position
it at a "new line"). The <lf> means move the platen one line position,
but don't move the carriage back to the full left position. This also
can reasonably be considered to be a "new line". And of course the
combination of <cr><lf> moves the tty carriage back to the full
left margin position, then advances the platen to the next line.

If you send <cr><lf> to a real teletype, it really does move to
the next "record" on the piece of paper. But if you were trying
to conserve bytes in a data file, you might quite reasonably make
the case that either <cr> or <lf> by themselves should be taken
as a "new line" indicator.

The good folks who invented Unix decided to use <lf>, and the
equally good folks who invented Smalltalk decided to use <cr>.
The folks who adopted the Microsoft <cr><lf> convention stole
the idea from CP/M or some such thing, which was probably stolen
from RMX-11. But regardless of who stole what from whom, none of
these conventions are in any way standard. They are conventions,
no more, no less.

Dave

p.s. The above pertains to ASCII based file conventions. EBCDIC
file systems have generally been record oriented from the get-go,
and do not seem to engender the sort of confusion that is typical
for ASCII based file systems.




More information about the Squeak-dev mailing list