Platform Line Termination?
R. A. Harmon
harmonra at webname.com
Sun Feb 6 22:48:31 UTC 2000
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.
>Does the SIF "standard" specify what kinds of line returns will be
>used? If so, those should be used in EVERY platform. If not, then
>does SIF specify that consistent line returns will be used? If not,
>I suppose you should presume they contain arbitrary, that is, plural
>line feed conventions between lines, converting each upon reading to
>CR. Of course, this creates a cross-platform nightmare in literal
>strings, particularly when a string intentionally contains line-ends.
>C'est la guerre.
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.
I think other Smalltalk dialects have dealt with this situation effectively.
Thanks,
--
Richard A. Harmon "The only good zombie is a dead zombie"
harmonra at webname.com E. G. McCarthy
Spencer, Iowa
More information about the Squeak-dev
mailing list
|