diff options
author | Mark H Weaver <mhw@netris.org> | 2014-01-14 17:38:30 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-01-14 20:30:24 -0500 |
commit | 6e504a7b44a9a25787bdfb2d86fdddd3029f4ba9 (patch) | |
tree | daf6719107fdc210458678811156c3d9bb60de93 /libguile/private-options.h | |
parent | dc59631d3094ad39bba5e40d5c36200fb99023f9 (diff) | |
download | guile-6e504a7b44a9a25787bdfb2d86fdddd3029f4ba9.tar.gz |
print: Support R7RS |...| symbol notation.
* libguile/print.c (scm_print_opts): Add 'r7rs-symbols' print option.
(symbol_has_extended_read_syntax): If the 'r7rs-symbols' option is
enabled, then disallow '|' and '\' from bare symbols.
(print_extended_symbol): Use 'scm_lfwrite' and 'scm_putc' instead of
'display_string' and 'display_character' when printing ASCII literals.
(print_r7rs_extended_symbol): New static function.
(scm_i_print_symbol_name): If the 'r7rs-symbols' option is enabled,
use 'print_r7rs_extended_symbol' instead of 'print_extended_symbol'.
* libguile/private-options.h (SCM_PRINT_R7RS_SYMBOLS_P): New macro.
(SCM_N_PRINT_OPTIONS): Increment.
* doc/ref/api-evaluation.texi (Scheme Write): Mention 'r7rs-symbols'
print option.
* test-suite/tests/print.test ("write"): Add tests.
Diffstat (limited to 'libguile/private-options.h')
-rw-r--r-- | libguile/private-options.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libguile/private-options.h b/libguile/private-options.h index 1a4ad0fb4..a3a0c2b94 100644 --- a/libguile/private-options.h +++ b/libguile/private-options.h @@ -52,7 +52,8 @@ SCM_INTERNAL scm_t_option scm_print_opts[]; #define SCM_PRINT_KEYWORD_STYLE_I 2 #define SCM_PRINT_KEYWORD_STYLE (SCM_PACK (scm_print_opts[2].val)) #define SCM_PRINT_ESCAPE_NEWLINES_P scm_print_opts[3].val -#define SCM_N_PRINT_OPTIONS 4 +#define SCM_PRINT_R7RS_SYMBOLS_P scm_print_opts[4].val +#define SCM_N_PRINT_OPTIONS 5 /* |