From 4fbd1a2b7f0db819e14d7cc862445d9ab3d0d80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 11 Apr 2018 00:52:40 +0200 Subject: gexp: 'scheme-file' can splice expressions. * guix/gexp.scm ()[splice?]: New field. (scheme-file): Add #:splice? and pass it to '%scheme-file'. (scheme-file-compiler): Pass SPLICE? to 'gexp->file'. (gexp->file): Add #:splice? and honor it. * tests/gexp.scm ("gexp->file + #:splice?"): New test. ("gexp->derivation & with-imported-module & computed module"): Use #:splice? #t. --- doc/guix.texi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 738fdf65ca..d825f39e0e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5221,8 +5221,12 @@ This is the declarative counterpart of @code{gexp->script}. @deffn {Monadic Procedure} gexp->file @var{name} @var{exp} @ [#:set-load-path? #t] [#:module-path %load-path] @ + [#:splice? #f] @ [#:guile (default-guile)] Return a derivation that builds a file @var{name} containing @var{exp}. +When @var{splice?} is true, @var{exp} is considered to be a list of +expressions that will be spliced in the resulting file. + When @var{set-load-path?} is true, emit code in the resulting file to set @code{%load-path} and @code{%load-compiled-path} to honor @var{exp}'s imported modules. Look up @var{exp}'s modules in @@ -5232,7 +5236,7 @@ The resulting file holds references to all the dependencies of @var{exp} or a subset thereof. @end deffn -@deffn {Scheme Procedure} scheme-file @var{name} @var{exp} +@deffn {Scheme Procedure} scheme-file @var{name} @var{exp} [#:splice? #f] Return an object representing the Scheme file @var{name} that contains @var{exp}. -- cgit v1.2.3