psyntax: custom ellipses using 'with-ellipsis' or R7RS syntax-rules.
authorMark H Weaver <mhw@netris.org>
Wed, 18 Dec 2013 23:49:37 +0000 (18:49 -0500)
committerMark H Weaver <mhw@netris.org>
Thu, 9 Jan 2014 22:41:19 +0000 (17:41 -0500)
commit1624e149f75747310c9ce15db7db5324a538f8f8
tree066f945459667eef41bf29e9d8c3cbe972b13a88
parent8de355d08e25a877326489c4b0eb09d313c548dc
psyntax: custom ellipses using 'with-ellipsis' or R7RS syntax-rules.

* module/ice-9/psyntax.scm (binding-type): Update the header comment
  to mention the new 'ellipsis' binding type.
  (macros-only-env): Preserve ellipsis bindings.
  (ellipsis?): Add 'r' and 'mod' as arguments.  Search the lexical
  environment for an ellipsis binding, and use it.
  (gen-syntax): Adapt to the additional arguments of 'ellipsis?'.
  (with-ellipsis): New core syntax.
  (convert-pattern): Add unary 'ellipsis?' procedure as an argument.
  (gen-clause): Adapt to the additional arguments of 'ellipsis?'.
  Pass unary 'ellipsis?' procedure to 'convert-pattern'.
  (syntax-case): Adapt to the additional arguments of 'ellipsis?'.
  (syntax-local-binding): Support new 'ellipsis' binding type.
  (syntax-rules): Add support for a custom ellipsis identifier as
  the first operand, as per R7RS.  Collect common code within new
  local procedure 'expand-syntax-rules'.

* module/ice-9/psyntax-pp.scm: Regenerate.

* module/ice-9/local-eval.scm (analyze-identifiers): Add support for
  'ellipsis' binding type.

* doc/ref/api-macros.texi (Syntax Rules): Add docs for R7RS custom
  ellipsis syntax.  Use @dots{}.
  (Syntax Case): Add docs for 'with-ellipsis'.  Use @dots{}.
  (Syntax Transformer Helpers): Update to include new 'ellipsis'
  binding type.

* test-suite/tests/syntax.test: Add tests.
doc/ref/api-macros.texi
module/ice-9/local-eval.scm
module/ice-9/psyntax-pp.scm
module/ice-9/psyntax.scm
test-suite/tests/syntax.test