Commit 6651b328 authored by Robert P. Goldman's avatar Robert P. Goldman

Fixed many boo-boos in the initial defsystem example.

A lot of this was out-of-date.  Added some FIXMEs for other things that
should be changed, but aren't yet.
parent 84b418b6
...@@ -1040,23 +1040,23 @@ software. ...@@ -1040,23 +1040,23 @@ software.
@section The defsystem form @section The defsystem form
@findex defsystem @findex defsystem
Systems can be constructed programmatically
by instantiating components using @code{make-instance}.
Most of the time, however, it is much more practical to use
a static @code{defsystem} form.
This section begins with an example of a system definition, This section begins with an example of a system definition,
then gives the full grammar of @code{defsystem}. then gives the full 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 This is a complete file that would
usually be saved as @file{hello-lisp.asd}: should be saved as @file{hello-lisp.asd} (in order that ASDF can find it
when ordered to operate on the system named @code{"hello-lisp"}).
@c FIXME: the first example should have an outside dependency, e.g.,
@c CL-PPCRE.
@lisp @lisp
(in-package :asdf) (in-package :asdf-user)
(defsystem "hello-lisp" (defsystem "hello-lisp"
:description "hello-lisp: a sample Lisp system." :description "hello-lisp: a sample Lisp system."
:version "0.2.1" :version "0.0.1"
:author "Joe User <joe@@example.com>" :author "Joe User <joe@@example.com>"
:licence "Public Domain" :licence "Public Domain"
:components ((:file "packages") :components ((:file "packages")
...@@ -1070,10 +1070,13 @@ Some notes about this example: ...@@ -1070,10 +1070,13 @@ Some notes about this example:
@item @item
The file starts with an @code{in-package} form The file starts with an @code{in-package} form
to use package @code{asdf}. for package @code{asdf-user}.
You could instead start your definition by using If your file is loaded by ASDF, this is the context in which it will be
a qualified name @code{asdf:defsystem}. read, so this line will ensure that the system definition is read the
same interactively as within ASDF.
@c FIXME: the following should probably be moved down to a more advanced
@c bit of the manual.
@item @item
If in addition to simply using @code{defsystem}, If in addition to simply using @code{defsystem},
you are going to define functions, you are going to define functions,
...@@ -1083,10 +1086,10 @@ you should create your own package for that purpose, ...@@ -1083,10 +1086,10 @@ you should create your own package for that purpose,
for instance replacing the above @code{(in-package :asdf)} with: for instance replacing the above @code{(in-package :asdf)} with:
@lisp @lisp
(defpackage :foo-system (defpackage :hello-lisp-system
(:use :cl :asdf)) (:use :cl :asdf))
(in-package :foo-system) (in-package :hello-lisp-system)
@end lisp @end lisp
@item @item
...@@ -1094,6 +1097,7 @@ The @code{defsystem} form defines a system named @code{hello-lisp} ...@@ -1094,6 +1097,7 @@ The @code{defsystem} form defines a system named @code{hello-lisp}
that contains three source files: that contains three source files:
@file{packages}, @file{macros} and @file{hello}. @file{packages}, @file{macros} and @file{hello}.
@c FIXME: The first example system should probably use just :serial T.
@item @item
The file @file{macros} depends on @file{packages} The file @file{macros} depends on @file{packages}
(presumably because the package it's in is defined in @file{packages}), (presumably because the package it's in is defined in @file{packages}),
...@@ -1115,6 +1119,8 @@ without having to edit the system definition. ...@@ -1115,6 +1119,8 @@ without having to edit the system definition.
@c FIXME: Should have cross-reference to "Version specifiers" in the @c FIXME: Should have cross-reference to "Version specifiers" in the
@c defsystem grammar, but the cross-referencing is so broken by @c defsystem grammar, but the cross-referencing is so broken by
@c insufficient node breakdown that I have not put one in. @c insufficient node breakdown that I have not put one in.
@c FIXME: this is way too detailed for the first example!
@c move it!
@item @item
Make sure you know how the @code{:version} numbers will be parsed! Make sure you know how the @code{:version} numbers will be parsed!
They are parsed as period-separated lists of integers. They are parsed as period-separated lists of integers.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment