[r6rs-discuss] Semicolon seems a poor choice to end inline hex escapes

Ben Goetter goetter at mazama.net
Tue Jul 3 16:12:28 EDT 2007


Per 5.97 4.2, semicolon is a delimiter, and a significant character in 
both end-of line and datum comments.  But this character also ends the 
inline hex escape sequence used in strings and, more troublesomely, 
identifiers.  This choice will make Scheme-sensitive text editor modes 
quite awkward to implement.

Hubba hubba;this is a comment
Hubba hu\xbb;and this is not a comment

I suggest that another character, vertical style (U+007C), be used to 
end inline hex escapes.  Furthermore, I would suggest that the sequence 
beginning an inline hex escape be changed to match the ending character, 
bracket-style, and that the character constant syntax be changed to 
match as well.

So, from 4.2,
 <inline hex escape> -> \|<hex scalar value>|
<character> -> #\<any character>
  -> #\<character name>
  -> #\|<hex scalar value>|

in 4.2.4,
H\|65|llo   Hello

in 4.2.6,
#\|FF|    U+00FF
#\|03BB|   U+03BB

in 4.2.7,
"\|41|bc"   "Abc"


If the paired vertical styles are too reminiscent of the nonstandard 
|identifier| syntax used by some Schemes, consider instead curly 
brackets, which would work even better in my opinion.

H\{65}llo
#\{FF}
"\{41}bc"
etc.

For your consideration,
Ben




More information about the r6rs-discuss mailing list