all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Guix-devel <guix-devel@gnu.org>
Subject: use-modules in gexps
Date: Sun, 02 Feb 2020 21:27:58 +0100	[thread overview]
Message-ID: <87r1zcspip.fsf@elephly.net> (raw)

Hi Guix,

I just watched the excellent FOSDEM talk about G-expressions by Chris
Marusich.  One person asked at the end about why it is necessary to use
“with-imported-modules” when inside of the G-expression “use-modules” is
used.

I wondered if perhaps we could add a G-expression compiler for module
imports, so that instead of

(with-imported-modules (source-module-closure '((my module)))
  #~(begin
     (use-modules (my module))
     …))

we would do

  #~(begin
     #$(use-modules (my module))
     …)

which would have the effect of adding (my module) — or the module
closure – to the list of modules needed by the current G-expression.

Can a G-expression compiler help accumulate state (e.g. by making
G-expressions values in the state monad) or can it only be compiled down
to a value at the current location?

--
Ricardo

             reply	other threads:[~2020-02-02 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02 20:27 Ricardo Wurmus [this message]
2020-02-05 14:19 ` use-modules in gexps Ludovic Courtès
2020-02-05 15:18   ` Ricardo Wurmus
2020-02-07 21:31     ` 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=87r1zcspip.fsf@elephly.net \
    --to=rekado@elephly.net \
    --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.