Next: , Previous: Configuring ASDF, Up: Top


5 Using ASDF

5.1 Loading a system

The system foo is loaded (and compiled, if necessary) by evaluating the following Lisp form:

     (asdf:load-system :foo)

On some implementations (namely recent versions of ABCL, Allegro CL, Clozure CL, CMUCL, ECL, GNU CLISP, LispWorks, MKCL, SBCL and XCL), ASDF hooks into the CL:REQUIRE facility and you can just use:

     (require :foo)

In older versions of ASDF, you needed to use (asdf:oos 'asdf:load-op :foo). If your ASDF is too old to provide asdf:load-system though we recommend that you upgrade to ASDF 3. See Loading an otherwise installed ASDF.

Note the name of a system is specified as a string or a symbol. If a symbol (including a keyword), its name is taken and lowercased. The name must be a suitable value for the :name initarg to make-pathname in whatever filesystem the system is to be found.

The lower-casing-symbols behaviour is unconventional, but was selected after some consideration. The type of systems we want to support either have lowercase as customary case (Unix, Mac, Windows) or silently convert lowercase to uppercase (lpns).

5.2 Other Operations

ASDF provides three commands for the most common system operations: load-system, compile-system or test-system. It also provides require-system, a version of load-system that skips trying to update systems that are already loaded.

Because ASDF is an extensible system for defining operations on components, it also provides a generic function operate (which is usually abbreviated by oos). You'll use oos whenever you want to do something beyond compiling, loading and testing.

Output from ASDF and ASDF extensions are sent to the CL stream *standard-output*, so rebinding that stream around calls to asdf:operate should redirect all output from ASDF operations.

For advanced users, note that require-system calls load-system with keyword arguments :force-not (already-loaded-systems). already-loaded-systems returns a list of the names of loaded systems. load-system applies operate with the operation from *load-system-operation*, which by default is load-op, the system, and any provided keyword arguments.

5.3 Moving on

That's all you need to know to use ASDF to load systems written by others. The rest of this manual deals with writing system definitions for Common Lisp software you write yourself, including how to extend ASDF to define new operation and component types.