guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gexps and ‘with-imported-modules’


From: Alex Kost
Subject: Re: gexps and ‘with-imported-modules’
Date: Mon, 04 Jul 2016 10:45:56 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Ludovic Courtès (2016-07-04 01:20 +0300) wrote:

> Hello!
>
> The ‘wip-gexp-imported-modules’ branch changes gexps so that each gexp
> embeds information about which modules need to be imported into its
> execution environment.
>
> Before you would do:
>
>   (gexp->derivation "foo"
>                     #~(begin
>                         (use-modules (guix build utils))
>                         …)
>                     #:modules '((guix build utils)))
>
> to specify that (guix build utils) must be imported in the build
> environment of “foo”.  After, it becomes:
>
>   (gexp->derivation "foo"
>                     (with-imported-modules '((guix build utils))
>                       #~(begin
>                           (use-modules (guix build utils))
>                           …)))
>
> The gain (not visible here) is that when you nest gexps, the outermost
> gexp now contains all the info about modules that need to be imported.
> That way, no side channel is needed to carry the imported module info
> (by “side channel”, I mean things like the ‘imported-modules’ field
> currently found in <shepherd-service> and several other places.)  Thus,
> it should be easier to compose gexps.

Great!  I like 'with-...' things.  And wow, you did a huge work again!

> I plan to merge it within a day or two.
>
> Comments welcome!

I see you added the indentation rule for 'with-imported-modules' in
"emacs/guix-devel.el".  I think it would also be good to add it to
'guix-devel-keywords' (as you did in commit cd6f6c22fb) to make it
highlighted as the other keywords.

-- 
Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]