diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index bf25c5981..44d2ee949 100755 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -1722,7 +1722,7 @@ name for each character. @tab 7 = @code{#\bel} @item 8 = @code{#\bs} @tab 9 = @code{#\ht} - @tab 10 = @code{#\lf} + @tab 10 = @code{#\lf} @tab 11 = @code{#\vt} @item 12 = @code{#\ff} @tab 13 = @code{#\cr} @@ -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 diff --git a/doc/ref/api-options.texi b/doc/ref/api-options.texi index 1b526a873..e77b421d9 100644 --- a/doc/ref/api-options.texi +++ b/doc/ref/api-options.texi @@ -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