[asdf-devel] [cclan-list] How to depend on a system optionally?

james anderson james.anderson at setf.de
Mon May 18 18:41:05 UTC 2009


On 2009-05-18, at 14:55 , Nikodemus Siivola wrote:

> 2009/5/18 Robert Goldman <rpgoldman at sift.info>:
>> Tobias C. Rittweiler wrote:
>>> I've read several times that it's a head ache to configure optional
>>> dependencies with ASDF.
>>>
>>> How true is that? Could we perhaps provide another clause
>>> :OPTIONALLY-DEPEND-ON in DEFSYSTEM which would load a system only if
>>> available?
>
> Doesn't :WEAKLY-DEPENDS-ON do what you want?

there is at least one more kind of dependency between two components:  
"contingency".

simple dependency intends this behaviour:

          component status    component a    component/feature  
b             effect
expression
a (:depends-on (:b))         present          
present                        (operate b), (operate a)
a (:depends-on (:b))         present          
absent                         error
a (:depends-on (:b))         absent           
present                        error
a (:depends-on (:b))         absent           
absent                         error


given the code in parse-component-form, :weakly-depends-on would  
appear to effect this behaviour:

          component status    component a    component/feature  
b             effect
expression
a (:weakly-depends-on (:b))  present          
present                        (operate b), (operate a)
a (:weakly-depends-on (:b))  present          
absent                         (operate a)
a (:weakly-depends-on (:b))  absent           
present                        error
a (:weakly-depends-on (:b))  absent           
absent                         error

there are cases, where it is useful to cause a different behaviour:

          component status    component a    component/feature  
b             effect
expression
a (:contingent-on (:b))      present          
present                        (operate a)
a (:contingent-on (:b))      present         absent
a (:contingent-on (:b))      absent           
present                        error
a (:contingent-on (:b))      absent           
absent                         error

perhaps there are others. this one is useful when building a system  
where the components depend on the on the runtime and/or o/s.







More information about the asdf-devel mailing list