From: Kaz Kylheku
Subject: [PATCH] asdf: load-op after load-source-op
Date: 
Message-ID: <1167558384.520130.241380@42g2000cwt.googlegroups.com>
ASDF's load-op does nothing after a load-source-op, because it doesn't
know that its effect was clobbered by that operation. The user's intent
is to switch to the compiled versions of the sources. Moreover, after
this is done, then if load-source-op is executed again, the intent is
to switch to the uncompiled sources again, so load-source-op must also
be aware that load-op clobbered /its/ effect.

The change to (setf component-property) is not essential. It implements
the logic that if the property doesn't exist and is being set to NIL,
it is not created.

(If anyone wants a clean version of this patch, not mangled by Google
Groups, or a version rediffed for the latest asdf.lisp, just holler.
It's small and simple enough to apply with cut and paste).

diff -u -r1.2 asdf/asdf.lisp
--- asdf/asdf.lisp      28 Dec 2006 07:16:31 -0000      1.2
+++ asdf/asdf.lisp      31 Dec 2006 09:27:18 -0000
@@ -279,10 +279,12 @@

 (defmethod (setf component-property) (new-value (c component)
property)
   (let ((a (assoc property (slot-value c 'properties) :test #'equal)))
-    (if a
-       (setf (cdr a) new-value)
+    (cond
+      (a
+       (setf (cdr a) new-value))
+      (new-value
        (setf (slot-value c 'properties)
-             (acons property new-value (slot-value c 'properties))))))
+             (acons property new-value (slot-value c
'properties)))))))

 (defclass system (module)
   ((description :accessor system-description :initarg :description)
@@ -751,10 +753,18 @@
 (defclass load-op (operation) ())

 (defmethod perform ((o load-op) (c cl-source-file))
-  (mapcar #'load (input-files o c)))
+  (let ((f (first (input-files o c))))
+    (if (load f)
+      (setf (component-property c 'last-loaded-as-source) nil))))

 (defmethod perform ((operation load-op) (c static-file))
   nil)
+
+(defmethod operation-done-p ((operation load-op) (c source-file))
+  (if (component-property c 'last-loaded-as-source)
+    nil
+    (call-next-method)))
+
 (defmethod operation-done-p ((operation load-op) (c static-file))
   t)