diff options
author | Andy Wingo <wingo@igalia.com> | 2013-03-13 11:41:01 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-03-13 11:43:35 +0100 |
commit | 8ae26afefee947c71314733c419519fb616bf36d (patch) | |
tree | 9a484e63f8c78e8f1870dd28bfdd66b7f97d8d1b /module/ice-9/psyntax.scm | |
parent | 9b977c836bf147d386944c401113aba32776fa68 (diff) | |
download | guile-8ae26afefee947c71314733c419519fb616bf36d.tar.gz |
add #:resolve-syntax-parameters? kwarg to syntax-local-binding
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document.
* module/ice-9/psyntax.scm (syntax-local-binding): Add
#:resolve-syntax-parameters? kwarg. Fixes bug 10991.
* module/ice-9/psyntax-pp.scm: Regenerate.
* test-suite/tests/syncase.test ("syntax-local-binding"): Add test.
Diffstat (limited to 'module/ice-9/psyntax.scm')
-rw-r--r-- | module/ice-9/psyntax.scm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm index 79f2fd41f..90c76d550 100644 --- a/module/ice-9/psyntax.scm +++ b/module/ice-9/psyntax.scm @@ -2648,7 +2648,7 @@ (arg-check nonsymbol-id? id 'syntax-module) (cdr (syntax-object-module id))) - (define (syntax-local-binding id) + (define* (syntax-local-binding id #:key (resolve-syntax-parameters? #t)) (arg-check nonsymbol-id? id 'syntax-local-binding) (with-transformer-environment (lambda (e r w s rib mod) @@ -2665,13 +2665,12 @@ (strip-anti-mark (syntax-object-wrap id)) r (syntax-object-module id) - ;; FIXME: come up with a better policy for - ;; resolve-syntax-parameters - #t)) + resolve-syntax-parameters?)) (lambda (type value mod) (case type ((lexical) (values 'lexical value)) ((macro) (values 'macro value)) + ((syntax-parameter) (values 'syntax-parameter (car value))) ((syntax) (values 'pattern-variable value)) ((displaced-lexical) (values 'displaced-lexical #f)) ((global) (values 'global (cons value (cdr mod)))) |