Missing \linefeed character

76 views
Skip to first unread message

Alan Thompson

unread,
Aug 30, 2016, 6:22:59 PM8/30/16
to clojure-dev
Hi,

Looking at the reader docs, I find:
​​

Characters - preceded by a backslash: \c. \newline, \space, \tab, \formfeed, \backspace, and\return yield the corresponding characters.
It appears there is no character literal for the linefeed character (ascii 10 or 0xA).  Is this an oversight?​ When parsing EOL in text CR and/or LF are the normal characters required, not FF (which most people have likely never used).

Thanks,
Alan

Gary Fredericks

unread,
Aug 30, 2016, 7:04:07 PM8/30/16
to cloju...@googlegroups.com
I'm confused; ascii 0xA, 0xC, and 0xD all have literals:

user> ((juxt seq (partial map int)) "\n\f\r")
[(\newline \formfeed \return) (10 12 13)]
is there something I'm missing?

--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev+unsubscribe@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojure-dev.
For more options, visit https://groups.google.com/d/optout.

Alan Thompson

unread,
Aug 30, 2016, 9:49:04 PM8/30/16
to cloju...@googlegroups.com
Hmmph.  I had always heard the single ASCII values referred to as CR and  LF.  The entry at https://en.wikipedia.org/wiki/Newline barely mentions NL, although it points out that different language & OS pairs may have different conventions for the escape sequence "\n" in a string.

I had always thought that "newline" meant the system-dependent version returned by System.lineSeparator().  I had never realized that in Clojure \newline was FF (0xA).

Alan

Reply all
Reply to author
Forward
0 new messages