aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-03-15 22:14:36 +0100
committerLudovic Courtès <ludo@gnu.org>2017-03-16 22:50:14 +0100
commitd938a58beefc669ab340aa1aeab49df3dc24d123 (patch)
treeebded7f194fee4e51b277c157258082b942aea09 /doc
parent4c0c4db0702048488a9712dbba7cad862c667d54 (diff)
downloadguix-d938a58beefc669ab340aa1aeab49df3dc24d123.tar
guix-d938a58beefc669ab340aa1aeab49df3dc24d123.tar.gz
gexp: Add '=>' syntax to import computed modules.
* guix/gexp.scm (imported-files)[file-pair]: Add case for pairs where the cdr is not a string. (imported-modules): Support '=>' syntax in MODULES. * tests/gexp.scm ("imported-files with file-like objects") ("gexp->derivation & with-imported-module & computed module"): New tests. * doc/guix.texi (G-Expressions): Document '=>' syntax for 'with-imported-modules'.
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi18
1 files changed, 16 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 78bf03de9e..2e70848e55 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4347,8 +4347,22 @@ of the @code{gexp?} type (see below.)
@deffn {Scheme Syntax} with-imported-modules @var{modules} @var{body}@dots{}
Mark the gexps defined in @var{body}@dots{} as requiring @var{modules}
-in their execution environment. @var{modules} must be a list of Guile
-module names, such as @code{'((guix build utils) (guix build gremlin))}.
+in their execution environment.
+
+Each item in @var{modules} can be the name of a module, such as
+@code{(guix build utils)}, or it can be a module name, followed by an
+arrow, followed by a file-like object:
+
+@example
+`((guix build utils)
+ (guix gcrypt)
+ ((guix config) => ,(scheme-file "config.scm"
+ #~(define-module @dots{}))))
+@end example
+
+@noindent
+In the example above, the first two modules are taken from the search
+path, and the last one is created from the given file-like object.
This form has @emph{lexical} scope: it has an effect on the gexps
directly defined in @var{body}@dots{}, but not on those defined, say, in