1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

psyntax: toplevel variable definitions discard previous syntactic binding.

* module/ice-9/psyntax.scm (expand-top-sequence): When defining a
  toplevel variable, use the value of the same-named imported
  _variable_, if any.  Do _not_ use an existing syntactic binding.

* module/ice-9/psyntax-pp.scm: Regenerate.
This commit is contained in:
Mark H Weaver 2013-12-24 06:42:51 -05:00
parent 306cc01d39
commit 8de355d08e
2 changed files with 6 additions and 2 deletions

View file

@ -629,7 +629,9 @@
(not (module-local-variable (current-module) n))
(current-module))
(let ((old (module-variable (current-module) n)))
(if (and (variable? old) (variable-bound? old))
(if (and (variable? old)
(variable-bound? old)
(not (macro? (variable-ref old))))
(module-define! (current-module) n (variable-ref old))
(module-add! (current-module) n (make-undefined-variable)))))
(values

View file

@ -1061,7 +1061,9 @@
(let ((old (module-variable (current-module) n)))
;; use value of the same-named imported variable, if
;; any
(if (and (variable? old) (variable-bound? old))
(if (and (variable? old)
(variable-bound? old)
(not (macro? (variable-ref old))))
(module-define! (current-module) n (variable-ref old))
(module-add! (current-module) n (make-undefined-variable)))))
(values