aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-03-28 21:16:36 +0100
committerLudovic Courtès <ludo@gnu.org>2015-03-29 22:23:33 +0200
commitb39fc6f7bcbe2c87247be48393a5a4105e08cc6d (patch)
treea1c55e725109f6faf05bdff092a3f1b0c6da7937
parent065b79549737a23731b30249c1e5889d6618231a (diff)
downloadpatches-b39fc6f7bcbe2c87247be48393a5a4105e08cc6d.tar
patches-b39fc6f7bcbe2c87247be48393a5a4105e08cc6d.tar.gz
doc: Update gexp wrt. extensibility.
This is a followup to bcb1328. * doc/guix.texi (G-Expressions): Move paragraph about extensibility below. Remove assumptions that things are either packages or derivations.
-rw-r--r--doc/guix.texi31
1 files changed, 16 insertions, 15 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 3c72e6596e..18e6733083 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2490,13 +2490,9 @@ Gexps are meant to be written to a file and run or manipulated by other
processes.
@item
-When a package or derivation is unquoted inside a gexp, the result is as
-if its output file name had been introduced.
-
-Actually this mechanism is not limited to package and derivation
-objects; @dfn{compilers} able to ``lower'' other high-level objects to
-derivations can be defined, such that these objects can also be inserted
-into gexps.
+When a high-level object such as a package or derivation is unquoted
+inside a gexp, the result is as if its output file name had been
+introduced.
@item
Gexps carry information about the packages or derivations they refer to,
@@ -2504,6 +2500,11 @@ and these dependencies are automatically added as inputs to the build
processes that use them.
@end itemize
+Actually this mechanism is not limited to package and derivation
+objects; @dfn{compilers} able to ``lower'' other high-level objects to
+derivations can be defined, such that these objects can also be inserted
+into gexps.
+
To illustrate the idea, here is an example of a gexp:
@example
@@ -2563,24 +2564,24 @@ or more of the following forms:
@table @code
@item #$@var{obj}
@itemx (ungexp @var{obj})
-Introduce a reference to @var{obj}. @var{obj} may be a package or a
+Introduce a reference to @var{obj}. @var{obj} may have one of the
+supported types, for example a package or a
derivation, in which case the @code{ungexp} form is replaced by its
output file name---e.g., @code{"/gnu/store/@dots{}-coreutils-8.22}.
-If @var{obj} is a list, it is traversed and any package or derivation
-references are substituted similarly.
+If @var{obj} is a list, it is traversed and references to supported
+objects are substituted similarly.
If @var{obj} is another gexp, its contents are inserted and its
dependencies are added to those of the containing gexp.
If @var{obj} is another kind of object, it is inserted as is.
-@item #$@var{package-or-derivation}:@var{output}
-@itemx (ungexp @var{package-or-derivation} @var{output})
+@item #$@var{obj}:@var{output}
+@itemx (ungexp @var{obj} @var{output})
This is like the form above, but referring explicitly to the
-@var{output} of @var{package-or-derivation}---this is useful when
-@var{package-or-derivation} produces multiple outputs (@pxref{Packages
-with Multiple Outputs}).
+@var{output} of @var{obj}---this is useful when @var{obj} produces
+multiple outputs (@pxref{Packages with Multiple Outputs}).
@item #+@var{obj}
@itemx #+@var{obj}:output