Table of ContentsASDF Getting StartedIntroductionSimple Lisp programs are defined in a single file; to use them, you load the file and go. More complicated systems, however, are made up of many files (and possibly depend on other systems made up of their own files). Using these requires loading the sub-systems and files in the right order – an error-prone and tedious task. ASDF is another system definition facility: a tool for describing the sub-systems and files that comprise a system and for operating on these components in the right order so that they can be compiled, loaded, tested, etc. ASDF presents two faces: one for system implementors who need to be able to describe their systems and one for Lisp programmers who want to use those systems. This document describes ASDF for the second audience. If you want to build your own systems with ASDF, then you'll also want to read the ASDF system definition guide. Installing ASDFDownloadMany Lisp implementations include a copy of ASDF. You can usually load this copy using Common-Lisp's require function: * (require 'asdf) ("ASDF") Consult your Lisp's documentation for details. If ASDF doesn't come bundled with your Lisp or if you want to make sure that you have the most recent version, then you'll want to download it from the common-lisp.net website. SetupThe single file asdf.lisp is all you need to use ASDF. Once you load it in a running Lisp, you're ready to go. For maximum convenience you will want to have ASDF loaded whenever you start your Lisp. check your implementation's manual for details on how to load it from the startup script or creating a custom Lisp image. UsingASDF provides three commands for the most common system operations: load-system, compile-system, and test-system: X load-system system &key function X compile-system system &key function X test-system system &rest args &key force (verbose t) version function
Shorthand for
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 X operate operation-class system &rest args &key (verbose t) version force &allow-other-keys function Operate does three things:
The traverse operation is wrapped in Note that dependencies may cause the operation to invoke other operations on the system or its components: the new operations will be created with the same initargs as the original one. X oos operation-class system &rest args &key force (verbose t) version &allow-other-keys function Short for operate on system and an alias for the operate function. Operate does three things:
The traverse operation is wrapped in Note that dependencies may cause the operation to invoke other operations on the system or its components: the new operations will be created with the same initargs as the original one. Before ASDF can operate on a system, however, it must be able to find that system's definition. How ASDF finds systemsYou can load system definition files by hand: (load "/path/to/my/system/my-system.asd")
or you can tell ASDF where to look to find them using the X *central-registry* variable A list of 'system directory designators' ASDF uses to find systems. A 'system directory designator' is a pathname or a function which evaluates to a pathname. For example: (setf asdf:*central-registry* (list '*default-pathname-defaults* #p"/home/me/cl/systems/" #p"/usr/share/common-lisp/systems/")) You'll need to set this variable up to match your system setup and will probably want to include it in your Lisp's startup script. Controlling where ASDF saves compiled files
Each Common Lisp implementation has its own format for compiled files (fasls for short). If you use multiple implementations (or multiple versions of the same implementation), you'll soon find your source directories littered with various As of version 1.365, ASDF includes ASDF-binary-locations to mitigate the problem. Default LocationsThe default binary location for each Lisp implementation is a subdirectory of each source directory. To account for different Lisps, Operating Systems, Implementation versions, and so on, ASDF borrows code from SLIME to create reasonable custom directory names. Here are some examples:
If you want to keep Here is a summary of the variables that control ASDF's source-to-binary mappings:
These variables are used by See the manual for more details. SummaryTo use ASDF:
IndicesCopyright © 2001-2009 Daniel Barlow and contributors ASDF has an MIT style license Last updated 18 October 2009 at 22:44 |