Next: , Previous: , Up: Using ASDF   [Contents][Index]


5.2 Convenience Functions

ASDF provides three commands for the most common system operations: load-system, compile-system, and test-system. It also provides require-system, a version of load-system that skips trying to update systems that are already loaded. And it provides make, a function that uses whichever operation was specified by the author of the target system, which by default behaves like load-system.

Because ASDF is an extensible system for defining operations on components, it also provides a generic function operate, so you may arbitrarily operate on your systems beyond the default operations. (At the interactive REPL, users often use its shorter alias oos, which stands for operate-on-system, a name inherited from mk-defsystem.) You’ll use operate whenever you want to do something beyond compiling, loading and testing.

Note that 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.

load-system applies operate with the operation from *load-system-operation* the system, and any provided keyword arguments. *load-system-operation* by default is load-op; it would be load-bundle-op by default on ECL, if only an implementation bug were fixed.

require-system skips any update to systems that have already been loaded, in the spirit of cl:require. It does it by calling load-system with a keyword option excluding already loaded systems.8. On actively maintained free software implementations (namely recent versions of ABCL, Clozure CL, CMUCL, ECL, GNU CLISP, MKCL and SBCL), once ASDF itself is loaded, cl:require too can load ASDF systems, by falling back on require-system for module names not recognized by the implementation.

Note that cl:require and require-system are appropriate to load code that is not being modified during the current programming session. This notably includes the implementation-provided extension modules that cl:require can load. This also includes any number of ASDF systems that the user isn’t either developing or debugging, for which a previously installed version is deemed to be satisfactory. require-system and through it cl:require can load these systems without any problem. But for code that you are actively developing, debugging, or otherwise modifying, you should use load-system, so ASDF will pick on your modifications and transitively re-build the modified files and everything that depends on them.

Finally, starting with ASDF 3.1, a function make is also available, that does “The Right Thing” with your system. The default behaviour is to load the system as if by load-system; but instead of this default, system authors can specify the intended use of their system by specifying their desired operation with a :build-operation argument in the system definition.


Footnotes

(8)

For the curious, the option is :force-not (already-loaded-systems).


Next: , Previous: , Up: Using ASDF   [Contents][Index]