[R6RS] string escapes

Matthew Flatt mflatt at cs.utah.edu
Thu Mar 9 11:26:56 EST 2006

At Thu, 09 Mar 2006 10:58:31 -0500, William D Clinger wrote:
> Matthew wrote:
> > My hesitation is that some Scheme systems already support C-like
> > escapes, and they may accept the former and treat it as "a;p;p;l;e;"
> > instead of "apple". It's a minor hassle, but for this reason I still
> > slightly prefer \x<X...>.
> If we're serious about replacing the "is an error"
> language of R5RS with "must raise a &lexical exception",
> then either syntax would require all implementations to
> raise an exception if they see "\x61\x70\x70\x6c\x65".
> Matthew's concern is not an issue unless we aren't really
> serious about requiring implementations to raise exceptions
> for lexical errors.

No, I'm not concerned with what happens when "\x61\x70\x70\x6c\x65" is
used in an R6RS program, but what happens when R6RS syntax is used
(intentionally or accidentally) in some other language.

Our job is to define R6RS, and we can't say anything in general about
non-R6RS languages. But we might try to avoid unnecessary confusion
with respect to other languages when we think confusion is likely
and/or significant.

In this case, I think some confusion is likely. A lot of code is
currently written for variants of Scheme that aren't R6RS --- but which
look a lot like R6RS. In the near future, I think we can expect many
implementations that are roughly "supersets" R6RS, were the implementor
tries to balance R6RS compatibility with implementation-specific
backward compatibility. In some cases, the implementor will have to
deal with incompatible string syntaxes.

So, it's not about raising exceptions for lexical errors in R6RS. But
there's certainly a question of whether the issue is relevant. My
opinion is strong enough to make me prefer \x<X...>, but weak enough
drop it unless someone else speaks up in favor of \x<X...>.


More information about the R6RS mailing list