When you dump and restore an image, or when you tweak your configuration, you may want to reset the ASDF configuration. For that you may use the following function:
undoes any ASDF configuration, regarding source-registry or output-translations.
If you use SBCL, CMUCL or SCL, you may use this snippet so that the ASDF configuration be cleared automatically as you dump an image:
#+(or cmu sbcl scl) (pushnew 'clear-configuration #+(or cmu scl) ext:*before-save-initializations* #+sbcl sb-ext:*save-hooks*)
For compatibility with all Lisp implementations, however,
you might want instead your build script to explicitly call
(asdf:clear-configuration) at an appropriate moment before dumping.
The system foo is loaded (and compiled, if necessary) by evaluating the following Lisp form:
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
and you can just use:
In older versions of ASDF, you needed to use
(asdf:oos 'asdf:load-op :foo
If your ASDF is too old to provide
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,
typically a keyword.
If a symbol (including a keyword), its name is taken and lowercased.
The name must be a suitable value for the
make-pathname in whatever filesystem the system is to be found.
The lower-casing-symbols behaviour is unconventional,
but was selected after some consideration.
Observations suggest that the type of systems we want to support
either have lowercase as customary case (unix, mac, windows)
or silently convert lowercase to uppercase (lpns),
so this makes more sense than attempting to use
which is reported not to work on some implementations
ASDF provides three commands for the most common system operations:
It also provides
require-system, a version of
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
(which is usually abbreviated by
oos whenever you want to do something beyond
compiling, loading and testing.
Output from ASDF and ASDF extensions are supposed to be sent
to the CL stream
and so rebinding that stream around calls to
should redirect all output from ASDF operations.
Reminder: before ASDF can operate on a system, however, it must be able to find and load that system's definition. See Configuring ASDF to find your systems.
For the advanced users, note that
with keyword arguments
already-loaded-systems returns a list of the names of loaded systems.
operate with the operation from
*load-system-operation*, which by default is
the system, and any provided keyword arguments.
To use ASDF:
(require "asdf")or else through
(asdf:load-system :my-system)or use some other operation on some system of your choice.
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.