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"
).
;; Usual Lisp comments are allowed here (defsystem "hello-lisp" :description "hello-lisp: a sample Lisp system." :version "0.0.1" :author "Joe User <joe@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:
defsystem
form defines a system named hello-lisp
that contains three source files:
packages.lisp, macros.lisp and hello.lisp.
.asd
file 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 hello-lisp
.
:bug-tracker
, :mailto
, :long-name
,
:long-description
, :source-control
),
it is strongly recommended to define the fields :description
, :version
, :author
, and :licence
,
especially if you intend your software to be eventually included in Quicklisp.
:version
numbers will be parsed!
Only period-separated non-negative integers are accepted at present.
See Version specifiers.
defsystem
declaration.
No in-package
form, no asdf:
package prefix, no nothing.
Just the one naked defsystem
form.
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.
Next: A more involved example, Previous: Defining systems with defsystem, Up: Defining systems with defsystem [Contents][Index]