asdf and provide / require

Gary King <[email protected]> Tue, 2 Sep 2008 22:40:29 -0400
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
I'd like to build a system A that loads certain files if and only if  
some other system B is _not_ loaded. One natural way to do this would  
be to have system B push some feature (call it :b) onto *features* and  
have system A say something like

:components ((:file "something-like-b" :depends-on ((feature  
(not :b)))))

which is supposed to say "compile and load the file 'something-like-b'  
if the feature :b is not present when you actually get around to  
loading this system. Depends-on isn't quite the right term but I'm  
hoping to keep changes down to a minimum.

The above won't work both because ASDF can't express anything about  
the absence of a feature and because you can't depend on a feature  
being present in the depends-on clause. The closest I think you can  
get now is

:in-order-to ((:compile-op (feature :foo)) (load-op (feature :bar))))

Is there some other to express what I want? Is there some reason that  
I shouldn't be trying to express this at all!

(Lastly, if there is any sense to this "include file iff some feature  
is present / absent, then why not generalize and allow

;; more complex feature tests
(:file "some-file" :include-when ((feature (:and :foo (:not :bar))))

;; more general computation
(:file "some-file" :include-when ((test (some-predicate-i-know-not- 
what-p)))

(In the last psuedo-example, I'm imaging that the current component  
and system are available via specials.)

thoughts and comments welcome,
--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/