[armedbear-cvs] r12804 - trunk/abcl/src/org/armedbear/lisp

Alessio Stalla astalla at common-lisp.net
Mon Jul 12 21:05:29 UTC 2010


Author: astalla
Date: Mon Jul 12 17:05:28 2010
New Revision: 12804

Log:
Fix r12768: macroexpand the body in an environment augmented with the newly-introduced function definitions to shadow macros with the same names.


Modified:
   trunk/abcl/src/org/armedbear/lisp/precompiler.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/precompiler.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/precompiler.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/precompiler.lisp	Mon Jul 12 17:05:28 2010
@@ -788,9 +788,15 @@
   (let ((*precompile-env* (make-environment *precompile-env*))
         (operator (car form))
         (locals (cadr form))
-        ;; precompile (thus macro-expand) the body before inspecting it
-        ;; for the use of our locals and optimizing them away
-        (body (mapcar #'precompile1 (cddr form))))
+	body)
+    ;; first augment the environment with the newly-defined local functions
+    ;; to shadow preexisting macro definitions with the same names
+    (dolist (local locals)
+      (environment-add-function-definition *precompile-env*
+					   (car local) (cddr local)))
+    ;; then precompile (thus macro-expand) the body before inspecting it
+    ;; for the use of our locals and optimizing them away
+    (setq body (mapcar #'precompile1 (cddr form)))
     (dolist (local locals)
       (let* ((name (car local))
              (used-p (find-use name body)))




More information about the armedbear-cvs mailing list