Skip to content
Snippets Groups Projects
Commit 8a8c98f1 authored by Daniel Barlow's avatar Daniel Barlow
Browse files

Added brief 'downloading' section

Added defpackage/in-package forms to the example defsystem

Some non-exhaustive notes on the differences with mk-defsystem
parent 56eac1f4
No related branches found
No related tags found
No related merge requests found
...@@ -118,6 +118,15 @@ properties ...@@ -118,6 +118,15 @@ properties
This chapter describes how to use asdf to compile and load ready-made This chapter describes how to use asdf to compile and load ready-made
Lisp programs and libraries. Lisp programs and libraries.
@section Downloading asdf
Some Lisp implementations (such as SBCL and OpenMCL) some with asdf
included already, so there is no need to download it separately.
Consult your Lisp system's documentation. If you need to download
asdf and install it by hand, the canonical source is the cCLan CVS
repository at
@url{http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cclan/asdf/}.
@section Setting up asdf @section Setting up asdf
The single file @file{asdf.lisp} is all you need to use asdf normally. The single file @file{asdf.lisp} is all you need to use asdf normally.
...@@ -144,7 +153,7 @@ init file, for example: ...@@ -144,7 +153,7 @@ init file, for example:
@section Setting up a system to be loaded @section Setting up a system to be loaded
To compile and load a system, you need to ensure that a symlink to its To compile and load a system, you need to ensure that a symbolic link to its
system definition is in one of the directories in system definition is in one of the directories in
@code{*central-registry*}@footnote{It is possible to customize the @code{*central-registry*}@footnote{It is possible to customize the
system definition file search. That's considered advanced use, and system definition file search. That's considered advanced use, and
...@@ -200,9 +209,15 @@ more practical to use a static @code{defsystem} form. This section ...@@ -200,9 +209,15 @@ more practical to use a static @code{defsystem} form. This section
begins with an example of a system definition, then gives the full begins with an example of a system definition, then gives the full
grammar of @code{defsystem}. grammar of @code{defsystem}.
Let's look at a simple system: Let's look at a simple system. This is a complete file that would
usually be saved as @file{hello-lisp.asd}:
@lisp @lisp
(defpackage hello-lisp-system
(:use :common-lisp :asdf))
(in-package :hello-lisp-system)
(defsystem "hello-lisp" (defsystem "hello-lisp"
:description "hello-lisp: a sample Lisp system." :description "hello-lisp: a sample Lisp system."
:version "0.2" :version "0.2"
...@@ -216,9 +231,20 @@ Let's look at a simple system: ...@@ -216,9 +231,20 @@ Let's look at a simple system:
Some notes about this example: Some notes about this example:
@itemize @itemize
@item
The file starts with @code{defpackage} and @code{in-package} forms to
make and use a package expressly for defining this system in. This
package is named by taking the system name and suffixing
@code{-system} - note that it is @emph{not} the same package as you
will use for the application code.
This is not absolutely required by asdf, but helps avoid namespace
pollution and so is considered good form.
@item @item
This form defines a system named "hello-lisp" that contains three The defsystem form defines a system named "hello-lisp" that contains
source files: @file{packages}, @file{macros} and @file{hello}. three source files: @file{packages}, @file{macros} and @file{hello}.
@item @item
The file @file{macros} depends on @file{packages} (presumably because The file @file{macros} depends on @file{packages} (presumably because
...@@ -231,7 +257,7 @@ file @file{hello}. ...@@ -231,7 +257,7 @@ file @file{hello}.
@item @item
The files are located in the same directory as the file with the The files are located in the same directory as the file with the
system definition. asdf resolves symlinks before loading the system system definition. asdf resolves symbolic links before loading the system
definition file and stores its location in the resulting definition file and stores its location in the resulting
system@footnote{It is possible, though almost never necessary, to system@footnote{It is possible, though almost never necessary, to
override this behaviour.}. This is a good thing because the user can override this behaviour.}. This is a good thing because the user can
...@@ -1118,11 +1144,13 @@ However, our architecture for extensibility better exploits CL ...@@ -1118,11 +1144,13 @@ However, our architecture for extensibility better exploits CL
language features (and is documented), and we intend to be portable language features (and is documented), and we intend to be portable
rather than just widely-ported. No slight on the mk-defsystem authors rather than just widely-ported. No slight on the mk-defsystem authors
and maintainers is intended here; that implementation has the and maintainers is intended here; that implementation has the
unenviable task of supporting non-ANSI implementations, which I unenviable task of supporting pre-ANSI implementations, which is
propose to ignore. no longer necessary.
The surface defsystem syntax of asdf is more-or-less compatible with The surface defsystem syntax of asdf is more-or-less compatible with
mk-defsystem mk-defsystem, except that we do not support the @code{source-foo} and
@code{binary-foo} prefixes for separating source and binary files, and
we advise the removal of all options to specify pathnames.
The mk-defsystem code for topologically sorting a module's dependency The mk-defsystem code for topologically sorting a module's dependency
list was very useful. list was very useful.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment