This section begins with an example of a system definition,
then gives the full grammar of
Let’s look at a simple system.
This is a complete file that should be saved as hello-lisp.asd
(in order that ASDF can find it
when ordered to operate on the system named
;; Usual Lisp comments are allowed here (defsystem "hello-lisp" :description "hello-lisp: a sample Lisp system." :version "0.0.1" :author "Joe User <email@example.com>" :licence "Public Domain" :depends-on ("optima.ppcre" "command-line-arguments") :components ((:file "packages") (:file "macros" :depends-on ("packages")) (:file "hello" :depends-on ("macros"))))
Some notes about this example:
defsystemform defines a system named
hello-lispthat contains three source files: packages.lisp, macros.lisp and hello.lisp.
.asdfile with the system definition.
optima.ppcre(that provides a friendly interface to matching regular expressions), and
command-line-arguments(that provides a way to parse arguments passed from the shell command line). To use this system, ASDF must be configured to find installed copies of these systems; it will load them before it tries to compile and load
:source-control), it is strongly recommended to define the fields
:licence, especially if you intend your software to be eventually included in Quicklisp.
:versionnumbers will be parsed! Only period-separated non-negative integers are accepted at present. See Version specifiers.
asdf:package prefix, no nothing. Just the one naked
defsystemform. This is what we recommend. More complex system definition files are possible with arbitrary Lisp code, but we recommend that you keep it simple if you can. This will make your system definitions more robust and more future-proof.
This is all you need to know to define simple systems. The next example is much more involved, to give you a glimpse of how you can do more complex things. However, since it’s ultimately arbitrary Lisp code, there is no bottom to the rabbit hole.