Platform Line Termination?

Andrew C. Greenberg werdna at gate.net
Sun Feb 6 23:11:17 UTC 2000


At 4:48 PM -0600 2/6/2000, R. A. Harmon wrote:
>At 01:36 PM 2/6/00 -0500, Andrew C. Greenberg wrote:
> >>I think the root of the problem is that when editing in browser window or a
> >>file's contents in a FileList (?), pasting text terminated with cr into a
> >>text terminated with crlf, or crlf into cr, will leave the resulting text
> >>with "mixed" line termination.
> >
> >Regardless of the LF conventions for external files, the fileIn after
> >reading should be CR-terminated.  Inside a Squeak browser, there
> >should be no LF at all, except perhaps in a literal string.  Inside
> >of Squeak, all text is terminated with cr.
>
>There is no check to insure that text entered in the browser is terminated
>only with crs.  If one copies a method source from a file with crlf and
>pastes it into a method in the browser, it now has crlf internally.  Re-edit
>the method, and add some new lines and it now has "mixed" line termination
>internally.

My point is that under ordinary operation, you shouldn't have lf's in 
a Squeak browser.  If you put one in there, it was a bug.  You 
shouldn't put one in there.

>As far as I can tell ANSI SIF does not specify.  The difficulty surfaces
>using other tools such as RCS, text editors, etc.  I think originally DOS
>screwed line termination up, and Windows inherits this screwy behavior.  It
>would just be easier on me if Squeak were a good member of the community and
>followed the community conventions, screwy as they are.

You asked for machine independence -- the preceding postings by 
various people so far has shown how that can be accomplished.  The 
"community conventions, screwy as they are" can be addressed quite 
easily with straightforward code, if you stay alive to the problem.

As to complying with machine dependencies as a means toward being a 
"good member of the community," I dissent.  Squeak runs pixel for 
pixel identically across more platforms than any other development 
system than any other implementation of any language with which I am 
familiar, including Java.  This was accomplished by taking a 
jaundiced eye toward such pecadillos, and just a little bit of extra 
work from time to time in the few cases where it is unavoidable.

>I think other Smalltalk dialects have dealt with this situation effectively.

As has Squeak, of course.  As has Squeak.





More information about the Squeak-dev mailing list