From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: gexps and =?utf-8?Q?=E2=80=98with-imported-modules=E2=80=99?= Date: Mon, 04 Jul 2016 15:39:28 +0200 Message-ID: <877fd1ed4f.fsf@gnu.org> References: <87oa6ebby5.fsf@gnu.org> <87wpl1j16z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK466-0003HE-DN for guix-devel@gnu.org; Mon, 04 Jul 2016 09:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK461-0002Pt-DC for guix-devel@gnu.org; Mon, 04 Jul 2016 09:39:37 -0400 In-Reply-To: <87wpl1j16z.fsf@gmail.com> (Alex Kost's message of "Mon, 04 Jul 2016 10:45:56 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Kost Cc: guix-devel Alex Kost skribis: > Ludovic Court=C3=A8s (2016-07-04 01:20 +0300) wrote: > >> Hello! >> >> The =E2=80=98wip-gexp-imported-modules=E2=80=99 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)) >> =E2=80=A6) >> #:modules '((guix build utils))) >> >> to specify that (guix build utils) must be imported in the build >> environment of =E2=80=9Cfoo=E2=80=9D. After, it becomes: >> >> (gexp->derivation "foo" >> (with-imported-modules '((guix build utils)) >> #~(begin >> (use-modules (guix build utils)) >> =E2=80=A6))) >> >> 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 =E2=80=9Cside channel=E2=80=9D, I mean things like the =E2=80=98impo= rted-modules=E2=80=99 field >> currently found in 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=E2=80=99ll be beneficial. It makes more sense to pr= ovide 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=E2=80=99.