From: ludo@gnu.org (Ludovic Courtès)
To: Alex Kost <alezost@gmail.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: gexps and ‘with-imported-modules’
Date: Mon, 04 Jul 2016 15:39:28 +0200 [thread overview]
Message-ID: <877fd1ed4f.fsf@gnu.org> (raw)
In-Reply-To: <87wpl1j16z.fsf@gmail.com> (Alex Kost's message of "Mon, 04 Jul 2016 10:45:56 +0300")
Alex Kost <alezost@gmail.com> skribis:
> 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!
Thank you. I think it’ll be beneficial. It makes more sense to provide
imported-module info at the gexp creation site rather than at the use
site.
>> 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.
Will do!
Ludo’.
next prev parent reply other threads:[~2016-07-04 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-03 22:20 gexps and ‘with-imported-modules’ Ludovic Courtès
2016-07-04 7:45 ` Alex Kost
2016-07-04 13:39 ` Ludovic Courtès [this message]
2016-07-12 20:58 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877fd1ed4f.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=alezost@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.