Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hugo Ishimaru
asdf
Commits
61ede11d
Commit
61ede11d
authored
10 years ago
by
Robert P. Goldman
Browse files
Options
Downloads
Patches
Plain Diff
Further tidied the defsystem examples.
parent
3a4110f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/asdf.texinfo
+64
-49
64 additions, 49 deletions
doc/asdf.texinfo
with
64 additions
and
49 deletions
doc/asdf.texinfo
+
64
−
49
View file @
61ede11d
...
@@ -1047,6 +1047,8 @@ software.
...
@@ -1047,6 +1047,8 @@ software.
@comment node-name, next, previous, up
@comment node-name, next, previous, up
@section The defsystem form
@section The defsystem form
@findex defsystem
@findex defsystem
@cindex asdf-user
@findex load-asd
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
}
.
...
@@ -1078,53 +1080,44 @@ Some notes about this example:
...
@@ -1078,53 +1080,44 @@ 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
for package @code
{
asdf-user
}
.
for package @code
{
asdf-user
}
. Quick summary: just do this, because it
This is optional.
helps make interactive development of @code
{
defsystem
}
forms behave in
If your file is loaded by ASDF 3,
the same was as when these forms are loaded by ASDF. If that's enough
this is the context in which it will be read;
for you, skip the rest of this item. Otherwise read on for the gory details.
this line will thus ensure that the system definition is read the
If your file is loaded by ASDF 3, it will be loaded into the
@code
{
asdf-user
}
package. The @code
{
in-package
}
form
will ensure that the system definition is read the
same as within ASDF when you load it interactively with @code
{
cl:load
}
.
same as within ASDF when you load it interactively with @code
{
cl:load
}
.
However, we recommend that you load @file
{
.asd
}
files
However, we recommend that you load @file
{
.asd
}
files
through function @code
{
asdf::load-asd
}
rather than through @code
{
cl:load
}
,
through function @code
{
asdf::load-asd
}
rather than through @code
{
cl:load
}
,
in which case
you don't need this @code
{
in-package
}
form
.
in which case
this form is unnecessary
.
Recent versions of SLIME (2013-02 and later) know to do
just
that.
Recent versions of SLIME (2013-02 and later) know to do that.
@c FIXME: the following should probably be moved down to a more advanced
@c bit of the manual.
@item
@item
You can always rely on symbols
You can always rely on symbols
from both package @code
{
asdf
}
and @code
{
common-lisp
}
from both package @code
{
asdf
}
and @code
{
common-lisp
}
being available in
to be readily available in the current package,
@code
{
.asd
}
files --
most importantly including @code
{
defsystem
}
itself.
most importantly including @code
{
defsystem
}
.
Indeed, starting with ASDF 3.1,
@file
{
.asd
}
files are read in the package @code
{
asdf-user
}
@c FIXME: the following should be inserted in a more advanced
that uses @code
{
asdf
}
, @code
{
uiop
}
and @code
{
uiop/common-lisp
}
@c bit of the manual. For now, it is simply elided.
(a variant of @code
{
common-lisp
}
@c Starting with ASDF 3.1,
that has some portability fixes on old implementations).
@c @file
{
.asd
}
files are read in the package @code
{
asdf-user
}
ASDF 3 releases before 3.1 also read in package @code
{
asdf-user
}
@c that uses @code
{
asdf
}
, @code
{
uiop
}
and @code
{
uiop/common-lisp
}
but that package don't use the full @code
{
uiop
}
, only @code
{
uiop/package
}
.
@c (a variant of @code
{
common-lisp
}
ASDF 1 and ASDF 2 releases (up until 2.26) instead read @file
{
.asd
}
files
@c that has some portability fixes on old implementations).
in a temporary package @code
{
asdf@emph
{
N
}}
@c ASDF 3 releases before 3.1 also read in package @code
{
asdf-user
}
that uses @code
{
asdf
}
and @code
{
common-lisp
}
.
@c but that package don't use the full @code
{
uiop
}
, only @code
{
uiop/package
}
.
You may thus have to package-qualify some symbols with @code
{
uiop:
}
@c ASDF 1 and ASDF 2 releases (up until 2.26) instead read @file
{
.asd
}
files
to support older variants of ASDF 3,
@c in a temporary package @code
{
asdf@emph
{
N
}}
and/or package-qualify them with @code
{
asdf::
}
@c that uses @code
{
asdf
}
and @code
{
common-lisp
}
.
to be compatible with even older variants of ASDF 2
@c You may thus have to package-qualify some symbols with @code
{
uiop:
}
(and then only use the few already available in ASDF 2).
@c to support older variants of ASDF 3,
@c and/or package-qualify them with @code
{
asdf::
}
@c to be compatible with even older variants of ASDF 2
@c (and then only use the few already available in ASDF 2).
@item
If in addition to simply using @code
{
defsystem
}
,
you are going to define functions,
create ASDF extension, globally bind symbols, etc.,
it is recommended that to avoid namespace pollution between systems,
you should create your own package for that purpose, with:
@lisp
(defpackage :hello-lisp-system
(:use :cl :asdf))
(in-package :hello-lisp-system)
@end lisp
@item
@item
The @code
{
defsystem
}
form defines a system named @code
{
hello-lisp
}
The @code
{
defsystem
}
form defines a system named @code
{
hello-lisp
}
...
@@ -1141,14 +1134,16 @@ This means that ASDF will compile and load @file{packages} and @file{macros}
...
@@ -1141,14 +1134,16 @@ This means that ASDF will compile and load @file{packages} and @file{macros}
before starting the compilation of file @file
{
hello
}
.
before starting the compilation of file @file
{
hello
}
.
@item
@item
The files are located in the same directory
System source files should be located in the same directory
as the file with the system definition.
as the @code
{
.asd
}
file with the system definition.
ASDF resolves symbolic links (or Windows shortcuts)
@c FIXME: the following should live somewhere, but not in the quickstart
before loading the system definition file and
@c page. [2014/05/03:rpg]
stores its location in the resulting system@footnote
{
@c ASDF resolves symbolic links (or Windows shortcuts)
It is possible, though almost never necessary, to override this behaviour.
}
.
@c before loading the system definition file and
This is a good thing because the user can move the system sources
@c stores its location in the resulting system@footnote
{
without having to edit the system definition.
@c It is possible, though almost never necessary, to override this behaviour.
}
.
@c This is a good thing because the user can move the system sources
@c 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
...
@@ -1172,6 +1167,8 @@ Let's illustrate some more involved uses of @code{defsystem} via a
...
@@ -1172,6 +1167,8 @@ Let's illustrate some more involved uses of @code{defsystem} via a
slightly convoluted example:
slightly convoluted example:
@lisp
@lisp
(in-package :asdf-user)
(defsystem "foo"
(defsystem "foo"
:version "1.0.0"
:version "1.0.0"
:components ((:module "mod"
:components ((:module "mod"
...
@@ -1221,7 +1218,7 @@ grammar}.
...
@@ -1221,7 +1218,7 @@ grammar}.
For more details on what these methods do, @pxref
{
Operations
}
in
For more details on what these methods do, @pxref
{
Operations
}
in
@ref
{
The object model of ASDF
}
.
@ref
{
The object model of ASDF
}
.
@c The following plunge into
the
weeds is not appropriate in this
@c
FIXME:
The following plunge into
detail
weeds is not appropriate in this
@c location. [2010/10/03:rpg]
@c location. [2010/10/03:rpg]
@c note that although this also supports @code
{
:before
}
methods,
@c note that although this also supports @code
{
:before
}
methods,
@c they may not do what you want them to ---
@c they may not do what you want them to ---
...
@@ -1229,6 +1226,24 @@ For more details on what these methods do, @pxref{Operations} in
...
@@ -1229,6 +1226,24 @@ For more details on what these methods do, @pxref{Operations} in
@c will run after all the dependencies and sub-components have been processed,
@c will run after all the dependencies and sub-components have been processed,
@c but before the component in question has been compiled.
@c but before the component in question has been compiled.
@c FIXME: There should be YA example that shows definitions of functions
@c and classes. The following material should go there.
@c @item
@c If in addition to simply using @code
{
defsystem
}
,
@c you are going to define functions,
@c create ASDF extension, globally bind symbols, etc.,
@c it is recommended that to avoid namespace pollution between systems,
@c you should create your own package for that purpose, with:
@c @lisp
@c (defpackage :hello-lisp-system
@c (:use :cl :asdf))
@c (in-package :hello-lisp-system)
@c @end lisp
@node The defsystem grammar, Other code in .asd files, A more involved example, Defining systems with defsystem
@node The defsystem grammar, Other code in .asd files, A more involved example, Defining systems with defsystem
@comment node-name, next, previous, up
@comment node-name, next, previous, up
@section The defsystem grammar
@section The defsystem grammar
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment