mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Document R6RS hex escapes
* doc/ref/api-data.texi (Characters, String Syntax): document r6rs hex escapes * doc/ref/api-options.texi (Reader Options): document r6rs-hex-escapes reader option
This commit is contained in:
parent
898a0b5a2e
commit
6ea3048785
2 changed files with 32 additions and 2 deletions
|
@ -1764,6 +1764,18 @@ Characters may also be written using their code point values. They can
|
|||
be written with as an octal number, such as @code{#\10} for
|
||||
@code{#\bs} or @code{#\177} for @code{#\del}.
|
||||
|
||||
When the @code{r6rs-hex-escapes} reader option is enabled, there is an
|
||||
additional syntax for character escapes: @code{#\xHHHH} -- the letter 'x'
|
||||
followed by a hexadecimal number of one to eight digits.
|
||||
|
||||
@lisp
|
||||
(read-enable 'r6rs-hex-escapes)
|
||||
@end lisp
|
||||
|
||||
Enabling this option will also change the hex escape format for strings. More
|
||||
on string escapes can be found at (@pxref{String Syntax}). More on reader
|
||||
options in general can be found at (@pxref{Reader options}).
|
||||
|
||||
@rnindex char?
|
||||
@deffn {Scheme Procedure} char? x
|
||||
@deffnx {C Function} scm_char_p (x)
|
||||
|
@ -2675,6 +2687,20 @@ The following are examples of string literals:
|
|||
"\"Hi\", he said."
|
||||
@end lisp
|
||||
|
||||
The three escape sequences @code{\xHH}, @code{\uHHHH} and @code{\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: @code{\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 @code{r6rs-hex-escapes}.
|
||||
|
||||
@lisp
|
||||
(read-enable 'r6rs-hex-escapes)
|
||||
@end lisp
|
||||
|
||||
Enabling this option will also change the hex escape format for characters.
|
||||
More on character escapes can be found at (@pxref{Characters}). More on
|
||||
reader options in general can be found at (@pxref{Reader options}).
|
||||
|
||||
@node String Predicates
|
||||
@subsubsection String Predicates
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@c -*-texinfo-*-
|
||||
@c This is part of the GNU Guile Reference Manual.
|
||||
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009
|
||||
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010
|
||||
@c Free Software Foundation, Inc.
|
||||
@c See the file guile.texi for copying conditions.
|
||||
|
||||
|
@ -510,6 +510,7 @@ keywords #f Style of keyword recognition: #f, 'prefix or 'postfix
|
|||
case-insensitive no Convert symbols to lower case.
|
||||
positions yes Record positions of source code expressions.
|
||||
copy no Copy source code expressions.
|
||||
r6rs-hex-escapes no Use R6RS-style string and character hex escapes
|
||||
@end smalllisp
|
||||
|
||||
Notice that while Standard Scheme is case insensitive, to ease
|
||||
|
@ -522,6 +523,9 @@ To make Guile case insensitive, you can type
|
|||
(read-enable 'case-insensitive)
|
||||
@end lisp
|
||||
|
||||
For more information on the effect of the @code{r6rs-hex-escapes} option, see
|
||||
(@pxref{Characters}) and (@pxref{String Syntax}).
|
||||
|
||||
@node Printing options
|
||||
@subsubsection Printing options
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue