Text lines are usually terminated with LF (\n, the 
POSIX+Unix+Linux+MacOS+default-Cygwin way) or CR LF (\r\n, the 
CP/M+MS-DOS+Windows way).  Others exist, and I've tried to accomodate them, but 
I think we should remove support for "reversed" LF CR line endings in the spec.

Background: Nobody officially uses LF CR as a line ending, but sometimes people 
screw up and generate reversed LF CR line-endings.  An EOL detector can, after 
reading an LF, peek to see if the next char is a CR (and if so consume that 
too), and thus be generous in what it accepts.

Sadly this can make interactive use annoying in guile, because of a 
longstanding bug in guile.  In guile, a "peek-char" actually *CONSUMES* an EOF, 
instead of just reporting it.  Yes, that's in violation of the Scheme R5RS, and 
probably most/all Scheme specs, but there it is.

This means that in interactive use, if you press "ENTER control-D" on POSIX 
system, a routine that peeks for CR will consume the EOF (ugh).  Working around 
that is a pain, you have to pass that EOF info all the way up, and I don't see 
that it's worth it. An LF CR is just too uncommon, and arguably a bug.

I don't mind supporting bare CR as end-of-line; that would generally be data 
files, not interactive use, and guile works fine with file EOF (guile just 
keeps regenerating EOF at the end of a real file).  Bare CR used to be used by 
many systems, including the Commodore 64, Apple II, and MacOS up to version 9, 
so there are still a few files that use it, and I don't see the harm in 
supporting it.

I plan to also support IBM NEL.

 --- David A. Wheeler

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to