[r6rs-discuss] [Formal] Allow inline hex escapes anywhere
Alan Watson
alan at alan-watson.org
Mon Mar 26 16:35:09 EDT 2007
John Cowan wrote:
> The difficulty with that idea (which is what Java uses) is that
> it changes the meaning of a\x20;b. Instead of being a single
> symbol of three characters, it is equivalent to a b, a sequence
> of two symbols.
Hmm. Yes. It would also make "\x22;" a syntax error rather than a string
containing a double quote, but that is less of a problem.
I guess one way to obtain my aim would be:
(a) To restrict non-delimited symbols to non-whitespace characters (or
perhaps restrict <constituent> to <letter> on page 12 of the draft); and
(b) To introduce a delimited symbol syntax, for example, #"...",
borrowed from Dylan.
On one hand, one would then have two forms of symbols. On the other, one
of those forms would now be very similar to strings, and, since one
would presumably be able to use escapes like \a in delimited symbols,
this would be a simplification.
>> This modification would also create a means to portably interchange
>> programs using only ASCII, although I'm not sure if this is especially
>> useful given UTF-8.
>
> In order to make the conversion reversible, it's necessary to use
> a pattern like Java's:
Yes, but I was not advocating that it be completely reversible, simply
noting that it appeared possible to express any Scheme program in ASCII.
Regards,
Alan
More information about the r6rs-discuss
mailing list