Next: A more involved example, Previous: Defining systems with defsystem, Up: Defining systems with defsystem [Contents][Index]
This section begins with an example of a system definition,
then gives the full grammar of defsystem
.
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 "hello-lisp"
).
(in-package :asdf-user) (defsystem "hello-lisp" :description "hello-lisp: a sample Lisp system." :version "0.0.1" :author "Joe User <joe@example.com>" :licence "Public Domain" :components ((:file "packages") (:file "macros" :depends-on ("packages")) (:file "hello" :depends-on ("macros"))))
Some notes about this example:
in-package
form
for package asdf-user
. Quick summary: just do this, because it
helps make interactive development of defsystem
forms behave in
the same was as when these forms are loaded by ASDF. If that’s enough
for you, skip the rest of this item. Otherwise read on for the gory details.
If your file is loaded by ASDF 3, it will be loaded into the
asdf-user
package. The in-package
form
will ensure that the system definition is read the
same as within ASDF when you load it interactively with cl:load
.
However, we recommend that you load .asd files
through function asdf::load-asd
rather than through cl:load
,
in which case this form is unnecessary.
Recent versions of SLIME (2013-02 and later) know to do that.
asdf
and common-lisp
being available in
.asd
files –
most importantly including defsystem
.
defsystem
form defines a system named hello-lisp
that contains three source files:
packages, macros and hello.
.asd
file with the system definition.
:version
numbers will be parsed!
Only period-separated non-negative integers are accepted.
See below Version specifiers in The defsystem grammar.
Next: A more involved example, Previous: Defining systems with defsystem, Up: Defining systems with defsystem [Contents][Index]