mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
only pass symbols to module-ref & c
* module/language/scheme/translate.scm: Make sure that we're actually passing symbols to module-ref et al.
This commit is contained in:
parent
75e03dee5b
commit
427d4a0c51
1 changed files with 8 additions and 6 deletions
|
@ -49,11 +49,12 @@
|
|||
|
||||
(define (lookup-transformer e head retrans)
|
||||
(let* ((mod (ghil-mod-module (ghil-env-mod e)))
|
||||
(val (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 (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)))))))
|
||||
(cond
|
||||
((or (primitive-macro? val) (eq? val eval-case))
|
||||
(or (assq-ref primitive-syntax-table head)
|
||||
|
@ -93,7 +94,8 @@
|
|||
|
||||
(else
|
||||
(let ((tail (map retrans tail)))
|
||||
(or (try-inline-with-env e l (cons head tail))
|
||||
(or (and (symbol? head)
|
||||
(try-inline-with-env e l (cons head tail)))
|
||||
(make-ghil-call e l (retrans head) tail)))))))
|
||||
|
||||
((symbol? x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue