mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
Document quote-syntax
* NEWS: Update. * doc/ref/api-macros.texi (Syntax Case): Update.
This commit is contained in:
parent
ec72aa7441
commit
c97e1fbb53
2 changed files with 25 additions and 2 deletions
9
NEWS
9
NEWS
|
@ -138,6 +138,10 @@ The Gnulib compatibility library has been updated, for the first time
|
|||
since 2017 or so. We expect no functional change but look forward to
|
||||
any bug reports.
|
||||
|
||||
** Optimized "eof-object?"
|
||||
|
||||
This predicate is now understood by the compiler.
|
||||
|
||||
* New interfaces and functionality
|
||||
|
||||
** `call-with-port'
|
||||
|
@ -168,10 +172,11 @@ similar, which will eventually be deprecated.
|
|||
|
||||
See "Annotated Scheme Read" in the manual.
|
||||
|
||||
** `syntax-sourcev'
|
||||
** `quote-syntax'
|
||||
|
||||
** Optimized "eof-object?"
|
||||
See "Syntax Case" in the manual.
|
||||
|
||||
** `syntax-sourcev'
|
||||
|
||||
* Bug fixes
|
||||
|
||||
|
|
|
@ -799,6 +799,24 @@ Note that @code{with-ellipsis} does not affect the ellipsis identifier
|
|||
of the generated code, unless @code{with-ellipsis} is included around
|
||||
the generated code.
|
||||
|
||||
@subsubsection Syntax objects can be data too
|
||||
|
||||
Generally speaking, you want the macro expander to pick apart all syntax
|
||||
objects in a source term. The source and scope annotations attached to
|
||||
the syntax object are of interest to how the macro expander computes the
|
||||
result, but no syntax object itself should appear in the expanded
|
||||
term---usually. Sometimes, though, a macro will want a syntax object to
|
||||
appear in the expanded output. Normally you would just use @code{quote}
|
||||
to introduce the syntax object as a value, but the expander strips
|
||||
syntax objects from subexpression of @code{quote}. For this rare use
|
||||
case, Guile has @code{quote-syntax}, which does not strip its
|
||||
subexpression.
|
||||
|
||||
@deffn {Syntax} quote-syntax form
|
||||
Expand to the syntax object @code{form}, as a constant literal. Like
|
||||
@code{quote}, but without calling @code{syntax->datum}.
|
||||
@end deffn
|
||||
|
||||
@node Syntax Transformer Helpers
|
||||
@subsection Syntax Transformer Helpers
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue