opening it up with Common Lisp
Book review: Darwinia
Summer reading: Spin
the Omnivoire's Delimma
the Golem's Eye
I used a home grown defsystem (EKSL's Generic Load Utilities) at my previous job but have been slowly moving towards ASDF over the last few months. Mostly, the differences are syntactic and it's a matter of mucking from one form to the other -- I know, I know, I should have written a program to do this but...
ASDF is, however, missing one feature that I had only recently added to GLU: the ability to automatically load other systems when they become relevant. An example or two might be in order.
Example #1: Metatilities is my basic tool set and bind is a handy thing. Metatilities and bind are separate tools and can be downloaded and used individually. However, when I have both metatilities and bind loaded, I'd like bind to be available in the metatilities package.
Example #2: Cl-Containers is a container library. CL-Variates is a set of portable Common Lisp random number generation routines. These are separate tools but when both are available, I want to use the routines in CL-Variates to select random elements from my containers.
Currently, I can accomplish both of these tasks by defining additional systems and loading them as needed. No real trouble but it's a hassle. I'd rather be able to express this and have my system definition tool take care of the rest. Thus: asdf-system-connections. It adds a new macro that's almost but not quite the same as defsystem. The addition is a :requires clause that lists the systems upon which this connection depends...
Here is a simple example from metabang.bind's system definition:
(asdf:defsystem-connection bind-and-metatilities :requires (metabang.bind metatilities-base) :perform (load-op :after (op c) (use-package (find-package "METABANG.BIND") (find-package "METATILITIES"))))
The requires clause specifies the other systems that must be loaded before this connection will be activated. The rest of the system definition regular ASDF. ASDF-System-connections will be loaded as soon as the systems their require are all loaded and they will only be loaded once. Before loading a system that uses a system connection, you should load ASDF-System-Connections in the usual manner:
(asdf:oos 'asdf:load-op 'asdf-system-connections)
ASDF-System-connections is brand new and relatively untested. It is available via darcs, ASDF-Install and direct download. Please let me know if anything goes awry.
Copyright -- Gary Warren King, 2004 - 2006