print: Support R7RS |...| symbol notation.
authorMark H Weaver <mhw@netris.org>
Tue, 14 Jan 2014 22:38:30 +0000 (17:38 -0500)
committerMark H Weaver <mhw@netris.org>
Wed, 15 Jan 2014 01:30:24 +0000 (20:30 -0500)
commit6e504a7b44a9a25787bdfb2d86fdddd3029f4ba9
treedaf6719107fdc210458678811156c3d9bb60de93
parentdc59631d3094ad39bba5e40d5c36200fb99023f9
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.
doc/ref/api-evaluation.texi
libguile/print.c
libguile/private-options.h
test-suite/tests/print.test