mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 18:20:22 +02:00
Implement read-syntax
* 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.
This commit is contained in:
parent
1bba859000
commit
a04a024f20
4 changed files with 55 additions and 40 deletions
|
@ -638,18 +638,18 @@ won't have access to the binding of @code{it}.
|
|||
|
||||
But they can, if we explicitly introduce a binding via @code{datum->syntax}.
|
||||
|
||||
@deffn {Scheme Procedure} datum->syntax template-id datum [srcloc]
|
||||
@deffn {Scheme Procedure} datum->syntax template-id datum [#:source=#f]
|
||||
Create a syntax object that wraps @var{datum}, within the lexical
|
||||
context corresponding to the identifier @var{template-id}. If
|
||||
@var{template-id} is false, the datum will have no lexical context
|
||||
information.
|
||||
|
||||
Syntax objects have an associated source location. @xref{Source
|
||||
Properties}. If a syntax object is passed as @var{srcloc}, the
|
||||
resulting syntax object will have the source properties of @var{srcloc}.
|
||||
Otherwise if @var{srcloc} is a source properties alist, those will be
|
||||
Properties}. If a syntax object is passed as @var{source}, the
|
||||
resulting syntax object will have the source properties of @var{source}.
|
||||
Otherwise if @var{source} is a source properties alist, those will be
|
||||
the source properties of the resulting syntax object. Otherwise if
|
||||
@var{srcloc} is false, the source properties are computed as
|
||||
@var{source} is false, the source properties are computed as
|
||||
@code{(source-properties @var{datum})}.
|
||||
@end deffn
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue