1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

add syntax-module

* module/ice-9/psyntax.scm (syntax-module): New accessor for syntax
  objects.
* module/ice-9/psyntax-pp.scm: Regenerate.

* module/ice-9/boot-9.scm: Declare syntax-module.

* doc/ref/api-macros.texi: Document it.
This commit is contained in:
Andy Wingo 2012-01-23 12:31:33 +01:00
parent 3d51e57cfb
commit 1ace4fbf3d
4 changed files with 7107 additions and 7078 deletions

View file

@ -706,6 +706,11 @@ Return the source properties that correspond to the syntax object
@var{x}. @xref{Source Properties}, for more information.
@end deffn
@deffn {Scheme Procedure} syntax-module id
Return the name of the module whose source contains the identifier
@var{id}.
@end deffn
@deffn {Scheme Procedure} syntax-local-binding id
Resolve the identifer @var{id}, a syntax object, within the current
lexical environment, and return two values, the binding type and a

View file

@ -385,6 +385,7 @@ If there is no handler at all, Guile prints an error and then exits."
(define datum->syntax #f)
(define syntax->datum #f)
(define syntax-source #f)
(define syntax-module #f)
(define identifier? #f)
(define generate-temporaries #f)
(define bound-identifier=? #f)

File diff suppressed because it is too large Load diff

View file

@ -2525,6 +2525,11 @@
(set! syntax-source
(lambda (x) (source-annotation x)))
(set! syntax-module
(lambda (id)
(arg-check nonsymbol-id? id 'syntax-module)
(cdr (syntax-object-module id))))
(set! syntax-local-binding
(lambda (id)
(arg-check nonsymbol-id? id 'syntax-local-binding)