Platform Line Termination?
Bert Freudenberg
bert at isgnw.CS.Uni-Magdeburg.De
Mon Feb 7 10:22:57 UTC 2000
> At 9:39 PM -0600 2/6/2000, Les Tyrrell wrote:
> >In the case of SIF, I believe the correct response is to pick
> >a single standard for the line termination, and stick with it.
> >SIF files are NOT text files in the host OS sense
I disagree. SIF files are text files - in contrast to the sources/changes
files, which are text databases that require fixed offsets.
> >If SIF does not specify, then I'd pick the simplest termination
> >standard and stick with it.
It won't work. You just can't rely on any specific line termination.
On Sun, 6 Feb 2000, Andrew C. Greenberg wrote:
> ON THE OTHER HAND, line endings embedded in literal strings cannot be
> so easily resolved.
Well, if one implementation uses LF internally for linebreaks, exports
this in SIF, and Squeak reads it - it would be ok if these ended up as CR,
right? It's bad style to embed LF/CR in literals anyway. Especially in
portable code. And we do have String>>withCRs, don't we?
As I see it, it's dog simple:
* On import, accept any mix of CR / LF / CRLF and replace it with the
Smalltalk-specific terminator (for Squeak, this would be cr).
* On export, use the platform convention. Usually the tools on that
platform are used for file transfer and can handle the native convention
best.
Maximum fault tolerance is the key here.
-Bert-
PS: How does this all relate to Masashi Umezawa's Dandelion?
(http://www.mars.dti.ne.jp/~umejava/smalltalk/stClasses/dandelion/)
More information about the Squeak-dev
mailing list
|