Discussion:
[Scheme-reports] something's wrong with R7RS (small) erratum 5
William D Clinger
2015-02-04 23:58:27 UTC
Permalink
http://trac.sacrideo.us/wg/wiki/R7RSSmallErrata erratum 5 says:

5. In section 7.1.1 (Lexical structure), the escape sequence
\| is not shown as permitted in strings. The list in
Section 6.7 shows that it is equivalent to |. This makes
the same escape sequences valid in both strings and
symbols.

The first sentence is clear enough, as is the second. We need
to add another production for <string element> with \| as its
right hand side.

The third sentence is then untrue. The (corrected) productions
for <string element> allow \" and \\, which are not allowed by
the productions for <symbol element>.

I suspect and hope the productions for <symbol element> need to
be corrected by adding productions for \" and \\. That would
make the third sentence of erratum 5 true.

Will
Alex Shinn
2015-02-05 07:21:30 UTC
Permalink
Post by William D Clinger
5. In section 7.1.1 (Lexical structure), the escape sequence
\| is not shown as permitted in strings. The list in
Section 6.7 shows that it is equivalent to |. This makes
the same escape sequences valid in both strings and
symbols.
The first sentence is clear enough, as is the second. We need
to add another production for <string element> with \| as its
right hand side.
The third sentence is then untrue. The (corrected) productions
for <string element> allow \" and \\, which are not allowed by
the productions for <symbol element>.
I suspect and hope the productions for <symbol element> need to
be corrected by adding productions for \" and \\. That would
make the third sentence of erratum 5 true.
Indeed, and this was always the intent, as section 2.1 explains
for identifier syntax:

Alternately, an identifier can be represented by a sequence
of zero or more characters enclosed withing vertical lines (|),
analogous to string literals. [...] In addition, characters can be
specified using either an <inline hex escape> or *the same*
* escapes available in strings*.

I'll update the errata to note that both productions should include
both \" and \| escapes (probably simplifying by adding both to
<mnemonic escape>).
--
Alex
Loading...