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

Alan Shields <[email protected]>
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
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
@@ -760,6 +760,11 @@
   (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
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.