diff options
Diffstat (limited to 'doc/ref/api-macros.texi')
-rw-r--r-- | doc/ref/api-macros.texi | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/doc/ref/api-macros.texi b/doc/ref/api-macros.texi index 83345a2f5..7bcca7a2b 100644 --- a/doc/ref/api-macros.texi +++ b/doc/ref/api-macros.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000-2004, 2009-2015, 2018 +@c Copyright (C) 1996, 1997, 2000-2004, 2009-2015, 2018, 2021 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -638,9 +638,19 @@ 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 -Create a syntax object that wraps @var{datum}, within the lexical context -corresponding to the identifier @var{template-id}. +@deffn {Scheme Procedure} datum->syntax template-id datum [srcloc] +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 +the source properties of the resulting syntax object. Otherwise if +@var{srcloc} is false, the source properties are computed as +@code{(source-properties @var{datum})}. @end deffn For completeness, we should mention that it is possible to strip the metadata |