[Scheme-reports] Symbol escapes - clarification Shiro Kawai (09 Jan 2012 13:17 UTC)
Re: [Scheme-reports] Symbol escapes - clarification John Cowan (09 Jan 2012 16:12 UTC)
Re: [Scheme-reports] Symbol escapes - clarification Peter Bex (09 Jan 2012 18:22 UTC)
Re: [Scheme-reports] Symbol escapes - clarification John Cowan (09 Jan 2012 19:52 UTC)
Re: [Scheme-reports] Symbol escapes - clarification Peter Bex (09 Jan 2012 19:59 UTC)
Re: [Scheme-reports] Symbol escapes - clarification John Cowan (10 Jan 2012 01:52 UTC)
Re: [Scheme-reports] Symbol escapes - clarification Alaric Snell-Pym (10 Jan 2012 10:36 UTC)
Re: [Scheme-reports] Symbol escapes - clarification Jussi Piitulainen (10 Jan 2012 10:54 UTC)
Re: [Scheme-reports] Symbol escapes - clarification Peter Bex (10 Jan 2012 11:14 UTC)
Re: [Scheme-reports] Symbol escapes - clarification Alaric Snell-Pym (10 Jan 2012 11:24 UTC)
Re: [Scheme-reports] Symbol escapes - clarification John Cowan (11 Mar 2012 20:05 UTC)
Re: [Scheme-reports] Symbol escapes - clarification Alaric Snell-Pym (10 Jan 2012 11:15 UTC)

Re: [Scheme-reports] Symbol escapes - clarification Peter Bex 09 Jan 2012 18:19 UTC

On Mon, Jan 09, 2012 at 11:12:07AM -0500, John Cowan wrote:
> I am not sure I understand this. \-escaping *is* allowed within
> |-escaping, so |(\x3BB;)| is the identifier "parenthesized lambda".
> Indeed, there is a ticket pending to disallow \-escaping by itself and
> allow it only within |-escaping.  That would allow \ to be an ordinary
> identifier character.

In "bare" symbols I'd expect anything but s-expression delimiters
(spaces, parens, semicolons and possibly single quotes, commas and
backticks) to be allowed but no "special interpretation" of composite
characters.  This keeps the reader simple; just consume characters
until you find an s-expression metacharacter.

> > - CL also has '|'-escapes but they don't delimit symbols, so
> > |abc|def|ghi| is read as a single symbol abcDEFghi.  R7RS doesn't
> > explicitly say '|' delimits the symbol, but also doesn't seem to
> > allow |abc|def syntax according to 7.1.1.  I'm fine with either way,
> > but was it a conscious decision?
>
> It was a conscious decision to make vertical bars delimit the symbol, in
> the same way that quotes delimit a string.  The wording of 2.1 is meant
> to imply this: a symbol can begin with |, contain arbitrary characters
> or inline hex escapes, and end with |.

I think I've argued this point before, but it would be more consistent
to allow \ to escape the | so that || acts exactly analogously to ""
in strings, where backslashes escape the delimiter.

This is simpler, more regular and allows implementation to use the same
routine for reading strings and symbols (with the delimiter as parameter).

Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports