[r6rs-discuss] strange escape sequence in string literals
r6rsguy at free-comp-shop.com
r6rsguy at free-comp-shop.com
Thu Nov 18 22:07:04 EST 2010
> From: Shiro Kawai <shiro at lava.net>
> From: Andy Wingo <wingo at pobox.com>
>
> > I wonder though, what is the purpose of allowing
> > intraline whitespace before the line ending?
>
> I don't remember if there was any discussion,
There was a little discussion. The first message in
that thread is below, from that it should be possible
to find it in archives.
> From: Per Bothner <per at bothner.com>
>
> On 11/18/2010 12:56 PM, Shiro Kawai wrote:
>
> A Scheme source file is a *text* file, rather than a
> binary file. The meaning of a text file should (by
> definition) be independent of the line-ending
> convention used. IMO the meaning of a text file
> should also be independent of trailing whitespace:
> Otherwise you will not be able to "store" a text file
> in a fixed-line-length file, as in a deck of cards
> (some of us remember using them) or fixed-length
> "record"-based representations, as used to be common
> on mainframes.
>
> Punch cards and fixed-length records are (hopefully)
> only of historical interest,
Some of you yung'uns may not remember, but the Egyptians
invented something that evolved into an important
fixed length recording medium. I refer to 8.5 by
11.5 paper. When I print my beautifully typeset
programs in a book, I do not want the meaning to
depend upon the width of the margins or indentation.
This lovely syntax lets me break string literals
at convenient places and put them between margins
of any size. I think it is a big improvement.
You guys may have spent too long in front of
the computer screen. A text is (by definition)
some ink on paper, a text file is an imitation
of that.
-- Keith Wright
Date: Mon, 9 Jul 2007 23:52:27 -0400
From: r6rsguy at free-comp-shop.com
To: r6rs-discuss at lists.r6rs.org
Subject: [r6rs-discuss] backslash-linefeed indentation
I have long been annoyed that Scheme does not allow
a program to be indented without changing its meaning,
and was working on a comment to fix that, when I noticed
that (I think) it has already been done in formal comment #9.
Am I right in thinking that the intention of the change
described there is that
(string=? "This is\
\ a string" "This is \
a string" "This is a string")
must be true? (The response to comment #9 confuses me.)
Should not (page 13)
<string element> -> ...
| \<intraline whitespace> <line ending> <intraline whitespace>
<intraline whitespace> -> <character tabulation>
| <any character whose category is Zs>
Have a Kleene star in there somewhere? E.g. either
<string element> -> ...
| \<intraline whitespace>* <line ending> <intraline whitespace>*
or
<intraline whitespace> -> ( <character tabulation>
| <any character whose category is Zs> )*
otherwise you are requiring exactly one space on each side
of a line break within a string?
More information about the r6rs-discuss
mailing list