Gary King | 14 Nov 02:12 2005

ASDF; systems without files but with performs don't perform...

Systems without files never do their perform steps... For example, if  
I have a system like:

> (in-package asdf)
>
> (defsystem foo
>   :perform (load-op :after (op c)
>                     (print "hi")))
>

and then do (asdf:oos asdf:load-op 'foo), "hi" won't be printed  
because the perform won't be called because from ASDF's perspective,  
there is nothing to do. I.e., (traverse <load-op> <foo-system>)  
returns nil.

I'd call this a bug but perhaps it's by design... thoughts?
--

-- 
Gary Warren King
metabang.com
http://www.metabang.com/

Attachment (smime.p7s): application/pkcs7-signature, 3198 bytes
Alan Shields | 18 Nov 00:27 2005

Proposed ASDF patch [1/2] - :weakly-depends-on

Adds :weakly-depends-on, which allows a system
to depend upon another system if that system is present in the system
and to ignore the dependency if it is not.

This is nice for optional-functionality.

There was talk on #lisp (yeah, there's ALWAYS talk on #lisp) about
more sophisticated methods that relied upon predicates, that allowed
options to be passed to the loader, etc, etc, but this was quick, easy,
and instantly useful.

I hope you'll find it worthy of inclusion,
Alan

--- /home/shieldsa/code/asdf-cvs/asdf.lisp	2005-09-26 17:54:42.000000000 -0500
+++ asdf.lisp	2005-11-17 17:10:57.000000000 -0600
 <at>  <at>  -930,10 +930,11  <at>  <at> 
 	      ;; remove-keys form.  important to keep them in sync
 	      components pathname default-component-class
 	      perform explain output-files operation-done-p
+	      weakly-depends-on
 	      depends-on serial in-order-to
 	      ;; list ends
 	      &allow-other-keys) options
-    (check-component-input type name depends-on components in-order-to)
+    (check-component-input type name weakly-depends-on depends-on components in-order-to)

     (when (and parent
 	     (find-component parent name)
 <at>  <at>  -946,14 +947,17  <at>  <at> 
(Continue reading)

Alan Shields | 18 Nov 00:30 2005

Proposed ASDF patch [2/2] - automatic push to features

This patch pushes :asdf-systemname onto features on 
successful load.

When combined with :weakly-depends-on this allows for some nice
behaviors for packages.

Pushing system names themselves onto *features* would be a bad idea -
as has been argued many times - but :asdf-systemname would seem to avoid
the namespace issue, and clearly communicate purpose at the same time.

Thanks,
Alan Shields

--- /home/shieldsa/code/asdf-cvs/asdf.lisp	2005-09-26 17:54:42.000000000 -0500
+++ asdf.lisp	2005-11-17 15:52:55.000000000 -0600
 <at>  <at>  -760,6 +760,11  <at>  <at> 
   (cons (list 'compile-op (component-name c))
         (call-next-method)))

+(defmethod asdf:perform :after ((operation load-op) (s system))
+  "After a system is loaded by ASDF, push ASDF-SYSTEMNAME onto *features*
+This enables easy use of #+asdf-systemname and friends"
+  (pushnew (intern (format nil "ASDF-~A" (string-upcase (component-name s))) :keyword) cl:*features*))
+
 ;;; load-source-op

 (defclass load-source-op (operation) ())

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
(Continue reading)


Gmane