1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 23:00:22 +02:00

remove elisp-strings and elisp-vectors read options

* libguile/private-options.h (SCM_ELISP_VECTORS_P, SCM_ESCAPED_PARENS_P):
* libguile/read.c (scm_read_opts): Remove unused elisp-vectors option,
  and the elisp-strings option (which allowed \( and \) escapes in
  strings).
  (scm_read_string): Remove the elisp-strings case.

* doc/ref/api-options.texi (Reader options): Update, and update wording
  of the case-insensitive bit.
This commit is contained in:
Andy Wingo 2010-10-01 10:20:54 +02:00
parent edca9d6ef4
commit 24259edb8b
3 changed files with 16 additions and 23 deletions

View file

@ -495,18 +495,22 @@ Here is the list of reader options generated by typing
values. values.
@smalllisp @smalllisp
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. copy no Copy source code expressions.
r6rs-hex-escapes no Use R6RS-style string hex escapes positions yes Record positions of source code expressions.
case-insensitive no Convert symbols to lower case.
keywords #f Style of keyword recognition: #f, 'prefix or 'postfix.
r6rs-hex-escapes no Use R6RS variable-length character and string hex escapes.
square-brackets yes Treat `[' and `]' as parentheses, for R6RS compatibility.
@end smalllisp @end smalllisp
Notice that while Standard Scheme is case insensitive, to ease Historically, many Scheme implementations have been case-insensitive,
translation of other Lisp dialects, notably Emacs Lisp, into Guile, treating @code{foo} and @code{FOO} as the same symbol. Guile has always
Guile is case-sensitive by default. defaulted to case-sensitivity, as allowed since the R4RS and codified in
the R6RS.
To make Guile case insensitive, you can type Guile also has a reader option to fold all symbols to their lower
case. To enable this option, perhaps for compatibility with older Scheme
code, you can enter
@lisp @lisp
(read-enable 'case-insensitive) (read-enable 'case-insensitive)

View file

@ -61,11 +61,9 @@ SCM_API scm_t_option scm_read_opts[];
#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val #define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
#define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val #define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val
#define SCM_KEYWORD_STYLE scm_read_opts[3].val #define SCM_KEYWORD_STYLE scm_read_opts[3].val
#define SCM_ELISP_VECTORS_P scm_read_opts[4].val #define SCM_R6RS_ESCAPES_P scm_read_opts[4].val
#define SCM_ESCAPED_PARENS_P scm_read_opts[5].val #define SCM_SQUARE_BRACKETS_P scm_read_opts[5].val
#define SCM_R6RS_ESCAPES_P scm_read_opts[6].val
#define SCM_SQUARE_BRACKETS_P scm_read_opts[7].val
#define SCM_N_READ_OPTIONS 8 #define SCM_N_READ_OPTIONS 6
#endif /* PRIVATE_OPTIONS */ #endif /* PRIVATE_OPTIONS */

View file

@ -71,10 +71,6 @@ scm_t_option scm_read_opts[] = {
"Convert symbols to lower case."}, "Convert symbols to lower case."},
{ SCM_OPTION_SCM, "keywords", (unsigned long) SCM_BOOL_F, { SCM_OPTION_SCM, "keywords", (unsigned long) SCM_BOOL_F,
"Style of keyword recognition: #f, 'prefix or 'postfix."}, "Style of keyword recognition: #f, 'prefix or 'postfix."},
{ SCM_OPTION_BOOLEAN, "elisp-vectors", 0,
"Support Elisp vector syntax, namely `[...]'."},
{ SCM_OPTION_BOOLEAN, "elisp-strings", 0,
"Support `\\(' and `\\)' in strings."},
{ SCM_OPTION_BOOLEAN, "r6rs-hex-escapes", 0, { SCM_OPTION_BOOLEAN, "r6rs-hex-escapes", 0,
"Use R6RS variable-length character and string hex escapes."}, "Use R6RS variable-length character and string hex escapes."},
{ SCM_OPTION_BOOLEAN, "square-brackets", 1, { SCM_OPTION_BOOLEAN, "square-brackets", 1,
@ -515,11 +511,6 @@ scm_read_string (int chr, SCM port)
case '"': case '"':
case '\\': case '\\':
break; break;
case '(':
case ')':
if (SCM_ESCAPED_PARENS_P)
break;
goto bad_escaped;
case '\n': case '\n':
continue; continue;
case '0': case '0':