1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

fix install-global construction of `define' forms

* module/ice-9/psyntax.scm (build-global-definition): Remove mod
  argument, as it does not seem we could ever define something in another
  module.
  (chi-install-global): Build the define as a definition, not an
  application. Doesn't matter now, but it will later.
  (chi-top): Fix build-global-definition call.

* module/ice-9/psyntax.scm: Regenerated.
This commit is contained in:
Andy Wingo 2009-05-07 10:27:53 +02:00
parent f4a644ee88
commit f27e9e11cd
2 changed files with 35 additions and 34 deletions

File diff suppressed because one or more lines are too long

View file

@ -423,7 +423,7 @@
(define-syntax build-global-definition
(syntax-rules ()
((_ source var exp mod)
((_ source var exp)
(build-annotated source `(define ,var ,exp)))))
(define-syntax build-lambda
@ -914,29 +914,30 @@
(let ((first (chi-top (car body) r w m esew mod)))
(cons first (dobody (cdr body) r w m esew mod))))))))
;; FIXME: module?
(define chi-install-global
(lambda (name e)
(build-application no-source
(build-primref no-source 'define)
(list
(build-global-definition
no-source
name
;; FIXME: seems nasty to call current-module here
(if (let ((v (module-variable (current-module) name)))
;; FIXME use primitive-macro?
(and v (variable-bound? v) (macro? (variable-ref v))
(not (eq? (macro-type (variable-ref v)) 'syncase-macro))))
(build-application no-source
(build-application
no-source
(build-primref no-source 'make-extended-syncase-macro)
(list (build-application no-source
(list (build-application
no-source
(build-primref no-source 'module-ref)
(list (build-application no-source 'current-module '())
(build-data no-source name)))
(build-data no-source 'macro)
e))
(build-application no-source
(build-application
no-source
(build-primref no-source 'make-syncase-macro)
(list (build-data no-source 'macro) e)))))))
(list (build-data no-source 'macro) e))))))
(define chi-when-list
(lambda (e when-list w)
@ -1138,7 +1139,7 @@
(case type
((global core macro module-ref)
(eval-if-c&e m
(build-global-definition s n (chi e r w mod) mod)
(build-global-definition s n (chi e r w mod))
mod))
((displaced-lexical)
(syntax-violation #f "identifier out of context"