The read syntax for strings is an arbitrarily long sequence of
characters enclosed in double quotes (").
Backslash is an escape character and can be used to insert the following
special characters. \" and \\ are R5RS standard, the
next seven are R6RS standard — notice they follow C syntax — and the
remaining four are Guile extensions.
\\\"" is otherwise the end
of the string).
\a\f\n\r\t\v\b\0\ followed by newline (ASCII 10)\ is the last character in a line, the
string will continue with the first character from the next line,
without a line break.
If the hungry-eol-escapes reader option is enabled, which is not
the case by default, leading whitespace on the next line is discarded.
"foo\
bar"
⇒ "foo bar"
(read-enable 'hungry-eol-escapes)
"foo\
bar"
⇒ "foobar"
\xHH\x7f for an ASCII DEL (127).
\uHHHH\u0100 for a capital A with macron (U+0100).
\UHHHHHH\U010402.
The following are examples of string literals:
"foo"
"bar plonk"
"Hello World"
"\"Hi\", he said."
The three escape sequences \xHH, \uHHHH and \UHHHHHH were
chosen to not break compatibility with code written for previous versions of
Guile. The R6RS specification suggests a different, incompatible syntax for hex
escapes: \xHHHH; – a character code followed by one to eight hexadecimal
digits terminated with a semicolon. If this escape format is desired instead,
it can be enabled with the reader option r6rs-hex-escapes.
(read-enable 'r6rs-hex-escapes)
For more on reader options, See Scheme Read.