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

mevenson at common-lisp.net mevenson at common-lisp.net
Tue Aug 23 10:43:05 UTC 2011


Author: mevenson
Date: Tue Aug 23 03:43:03 2011
New Revision: 13532

Log:
Fix compiler for compile-time toplevel defstruct with print-object.

Fixes some problems which arose in compiling SBCL.

Modified:
   trunk/abcl/src/org/armedbear/lisp/compile-file.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/compile-file.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/compile-file.lisp	Mon Aug 22 07:48:39 2011	(r13531)
+++ trunk/abcl/src/org/armedbear/lisp/compile-file.lisp	Tue Aug 23 03:43:03 2011	(r13532)
@@ -271,13 +271,17 @@
                           (format *error-output* "; Unable to compile method~%"))))))))))
 
 
+    (when compile-time-too
+      (let* ((copy-form (copy-tree form))
+             ;; ### Ideally, the precompiler would leave the forms alone
+             ;;  and copy them where required, instead of forcing us to
+             ;;  do a deep copy in advance
+             (precompiled-form (precompiler:precompile-form copy-form nil
+                                                            *compile-file-environment*)))
+        (eval precompiled-form)))
     (convert-ensure-method form :function)
     (convert-ensure-method form :fast-function))
-  (let ((form (precompiler:precompile-form form nil
-                                           *compile-file-environment*)))
-    (when compile-time-too
-      (eval form))
-    form))
+  (precompiler:precompile-form form nil *compile-file-environment*))
 
 (declaim (ftype (function (t t t) t) process-toplevel-defvar/defparameter))
 (defun process-toplevel-defvar/defparameter (form stream compile-time-too)




More information about the armedbear-cvs mailing list