mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-21 20:20:24 +02:00
allow defmacros to unquote in macros into expanded expressions
* module/language/scheme/compile-ghil.scm (lookup-transformer): Allow macros to be unquoted into the car of any form that results from macro expansion. This lets modules export defmacros built on other defmacros that are not exported.
This commit is contained in:
parent
9892287960
commit
277f728b14
1 changed files with 11 additions and 6 deletions
|
@ -89,12 +89,17 @@
|
|||
;; FIXME shadowing lexicals?
|
||||
(define (lookup-transformer head retrans)
|
||||
(let* ((mod (current-module))
|
||||
(val (and (symbol? head)
|
||||
(and=> (module-variable mod head)
|
||||
(lambda (var)
|
||||
;; unbound vars can happen if the module
|
||||
;; definition forward-declared them
|
||||
(and (variable-bound? var) (variable-ref var)))))))
|
||||
(val (cond
|
||||
((symbol? head)
|
||||
(and=> (module-variable mod head)
|
||||
(lambda (var)
|
||||
;; unbound vars can happen if the module
|
||||
;; definition forward-declared them
|
||||
(and (variable-bound? var) (variable-ref var)))))
|
||||
;; allow macros to be unquoted into the output of a macro
|
||||
;; expansion
|
||||
((macro? head) head)
|
||||
(else #f))))
|
||||
(cond
|
||||
((hashq-ref *translate-table* val))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue