psyntax: toplevel variable definitions discard previous syntactic binding.
[bpt/guile.git] / module / ice-9 / psyntax.scm
index fa009d2..7574f54 100644 (file)
                                   (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