read: Support R7RS |...| symbol notation.
authorMark H Weaver <mhw@netris.org>
Sun, 12 Jan 2014 12:55:22 +0000 (07:55 -0500)
committerMark H Weaver <mhw@netris.org>
Wed, 15 Jan 2014 01:23:21 +0000 (20:23 -0500)
commitdc59631d3094ad39bba5e40d5c36200fb99023f9
tree8448ce41b34541c89edecdee8e841fde77a2b5eb
parentb306fae0abe38aac6fede98727a47f57a4ba992f
read: Support R7RS |...| symbol notation.

* libguile/private-options.h (SCM_R7RS_SYMBOLS_P): New macro.
  (SCM_N_READ_OPTIONS): Increment.

* libguile/read.c (scm_read_opts): Add entry for 'r7rs-symbols'.
  (t_read_opts): Add field for 'r7rs_symbols_p'.
  (scm_read_string_like_syntax): New function based on earlier
  'scm_read_string' that handles either string literals or R7RS quoted
  symbols (delimited by vertical bars), depending on the value of 'chr'.
  (scm_read_string): Reimplement based on 'scm_read_string_like_syntax'.
  (scm_read_r7rs_symbol): New static function.

* doc/ref/api-data.texi (Symbol Read Syntax): Briefly describe the R7RS
  symbol syntax, mention the 'r7rs-symbols' read option, and give some
  examples.

* doc/ref/api-evaluation.texi (Scheme Read): Mention the 'r7rs-symbols'
  read option.

* test-suite/tests/reader.test ("reading"): Add test.
doc/ref/api-data.texi
doc/ref/api-evaluation.texi
libguile/private-options.h
libguile/read.c
test-suite/tests/reader.test