[R6RS] string escapes
Matthew Flatt
mflatt at cs.utah.edu
Thu Mar 2 13:40:53 EST 2006
Backslash escapes in the Unicode SRFI inspired considerable complaint.
As far as I can tell, there is sight opposition to additions like \n
and \t. There was more substantial opposition to \x, \u, and \U,
because there are three of them, and because there's no ending
delimiter.
Given that we've abandoned C-ish compatibility in other ways, and that
ugly \x, \u, and \U are ugly and unpopular, I suggest that we
reconsider.
Among the various suggestions, I found Jorgen Schaefer's suggestion
most palatable:
http://srfi.schemers.org/srfi-75/mail-archive/msg00259.html
(see the "String Escape" section)
but I would like something even more regular. If we used
\x(X...)
in strings, we couldn't use the same syntax for characters, because "("
is a delimiter outside of strings. So maybe
\x<X...>
in strings and symbols and
#\x<X....>
for characters, where the "<" and ">" are literal and "X" stands for a
hex digit.
Of course, if we escape delimiters, we could use Scheme syntax for
numbers, as suggested before. But I like the simplicity of hex-only
combined with the readability of escape delimiters.
Opinions?
Matthew
More information about the R6RS
mailing list