1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +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:
Andy Wingo 2008-08-02 12:46:14 +02:00
parent 75e03dee5b
commit 427d4a0c51

View file

@ -49,11 +49,12 @@
(define (lookup-transformer e head retrans) (define (lookup-transformer e head retrans)
(let* ((mod (ghil-mod-module (ghil-env-mod e))) (let* ((mod (ghil-mod-module (ghil-env-mod e)))
(val (and=> (module-variable mod head) (val (and (symbol? head)
(lambda (var) (and=> (module-variable mod head)
;; unbound vars can happen if the module (lambda (var)
;; definition forward-declared them ;; unbound vars can happen if the module
(and (variable-bound? var) (variable-ref var)))))) ;; definition forward-declared them
(and (variable-bound? var) (variable-ref var)))))))
(cond (cond
((or (primitive-macro? val) (eq? val eval-case)) ((or (primitive-macro? val) (eq? val eval-case))
(or (assq-ref primitive-syntax-table head) (or (assq-ref primitive-syntax-table head)
@ -93,7 +94,8 @@
(else (else
(let ((tail (map retrans tail))) (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))))))) (make-ghil-call e l (retrans head) tail)))))))
((symbol? x) ((symbol? x)