* doc/ref/api-macros.texi (Syntax Rules): Use archived URL from
Internet Archive for syntax-rules primer.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* doc/ref/api-macros.texi: make the macro expand to the literal
date, not to a call to the date function. The example previously
did not actually need eval-when and did not show the intended
effect.
* doc/ref/api-macros.texi (Syntax Case): Update documentation for
datum->syntax.
* module/ice-9/psyntax.scm (datum->syntax): Use #:source keyword for
source location info instead of an optional, and allow an alist.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/read.scm (%read, read): Refactor to allow read and
read-syntax to share an implementation.
(read-syntax): New function.
* doc/ref/api-macros.texi (Syntax Case): Document that template-id can
be false, and document srcloc.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/psyntax.scm (syntax?): Allow the lexical context to be
null. Allow srcloc to be a source properties alist. Inspired by
Racket.
* module/ice-9/psyntax.scm (syntax?): Only recognize legacy syntax
objects if the new allow-legacy-syntax-objects? parameter is true.
* module/ice-9/boot-9.scm (allow-legacy-syntax-objects?): New
parameter.
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document the
horrible situation with legacy syntax objects.
* NEWS: Add entry.
* doc/ref/api-macros.texi (Eval When): Explain in detail what each
condition means, including 'expand' which was previously undocumented.
Change the example to use (expand load eval) and recommend that set of
conditions, instead of (compile load eval) which was previously
recommended and shown in the example.
* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-46.
* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-46 to the list of core
features.
(SRFI-46): New node.
* doc/ref/api-macros.texi (Syntax Rules): Mention that the custom
ellipsis identifier support is specified by SRFI-46.
* test-suite/tests/syntax.test ("syntax-rules"): Add ellipsis hygiene
test from SRFI-46.
* 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 (Macro Expansion): New section.
* doc/ref/api-procedures.texi (Compiled Procedures): Beginnings of a
revision. Not finished.
* doc/ref/compiler.texi (Compiling to the Virtual Machine): Beginnings
of a revision. CPS and bytecode are not done yet.
Fixes <http://bugs.gnu.org/14203> reported by Nikita Karetnikov.
* doc/ref/api-macros.texi (Defining Macros, Syntax Rules): Fix
definition of 'my-or' example macro to use the let-bound variable.
* module/ice-9/boot-9.scm:
* module/ice-9/psyntax.scm (syntax-module, syntax-local-binding)
(syntax-locally-bound-identifiers): After boot, move these definitions
to a new (system syntax) module.
* module/ice-9/psyntax-pp.scm: Regenerate.
* doc/ref/api-macros.texi: Add some words about syntax-module and
friends being in (system syntax).
* module/ice-9/boot-9.scm (syntax-local-binding): New binding.
* module/ice-9/psyntax.scm: Locally define a fluid that holds the
"transformer environment". with-transformer-environment calls a
procedure with the transformer environment, or raises an error if
called outside the extent of a transformer. Bind
transformer-environment in expand-macro.
(resolve-identifier): Backport this helper from master.
(syntax-local-binding): New procedure to return binding information of
a bound identifier (a lexical, macro, a pattern variable, a displaced
lexical, a global, or some other form).
* module/ice-9/psyntax-pp.scm: Regenerate.
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Add docs for
syntax-local-binding, and syntax-source, and move some other
descriptions to this new section.
* doc/ref/api-macros.texi: New file, documenting macros. Removed some
old cruft, and started documenting hygienic macros.
* doc/ref/api-procedures.texi: Moved macro things out of here.
* doc/ref/guile.texi: Separate macros from procedures.
* doc/ref/api-data.texi: Update some xrefs.
* doc/ref/Makefile.am: Add api-macros.texi.