Next: scheme lex syntax strings, Previous: scheme lex syntax booleans, Up: scheme lex syntax [Index]
Characters are represented using the notation #\<character>
or
#\<character name>
or #\x<hex scalar value>
.
For example:
#\a lower case letter a #\A upper case letter A #\( left parenthesis #\ space character #\nul U+0000 #\alarm U+0007 #\backspace U+0008 #\tab U+0009 #\linefeed U+000A #\newline U+000A #\vtab U+000B #\page U+000C #\return U+000D #\esc U+001B #\space U+0020 preferred way to write a space #\delete U+007F #\xFF U+00FF #\x03BB U+03BB #\x00006587 U+6587 #\x0001z &lexical exception #\alarmx &lexical exception #\alarm x U+0007 followed by x #\Alarm &lexical exception #\alert &lexical exception #\xA U+000A #\xFF U+00FF #\xff U+00FF #\x ff U+0078 followed by another datum, ff #\x(ff) U+0078 followed by another datum, a parenthesized ff #\(x) &lexical exception #\(x &lexical exception #\((x) U+0028 followed by another datum, parenthesized x #\x00110000 &lexical exception out of range #\x000000001 U+0001 #\xD800 &lexical exception in excluded range
(The notation &lexical
means that the line in question is a
lexical syntax violation.)
Case is significant in #\<character>
, and in #\<character
name>
, but not in the <hex scalar value>
of #\x<hex scalar
value>
. A ?character must be followed by a ?delimiter or
by the end of the input. This rule resolves various ambiguous cases
involving named characters, requiring, for example, the sequence of
characters #\space
to be interpreted as the space character
rather than as the character #\s
followed by the identifier
pace
.
NOTE The
#\newline
notation is retained for backward compatibility. Its use is deprecated;#\linefeed
should be used instead.