unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#29296] [PATCH 0/2] gexp: Add 'let-system'
@ 2017-11-14 16:18 Ludovic Courtès
  2017-11-14 16:25 ` [bug#29296] [PATCH 1/2] gexp: Compilers can now return lowerable objects Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2017-11-14 16:18 UTC (permalink / raw)
  To: 29296

Hello!

This patch adds the ‘let-system’ form to (guix gexp), as discussed with
Mathieu at <https://bugs.gnu.org/29281>.  It allows you to insert
system-dependent code inside a gexp, as in this example:

      #~(system*
         #+(let-system system
             (cond ((string-prefix? "armhf-" system)
                    (file-append qemu "/bin/qemu-system-arm"))
                   ((string-prefix? "x86_64-" system)
                    (file-append qemu "/bin/qemu-system-x86_64"))
                   (else
                    (error "dunno!"))))
         "-net" "user" #$image)

(Using (%current-system) and (%current-target-system) does *not* achieve
this, in case you’re wondering, because at the time the gexp is defined
they carry their default value.)

Feedback welcome!

Ludo’.

Ludovic Courtès (2):
  gexp: Compilers can now return lowerable objects.
  gexp: Add 'let-system'.

 doc/guix.texi  |  26 ++++++++++++++
 guix/gexp.scm  | 105 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 tests/gexp.scm |  50 +++++++++++++++++++++++++++
 3 files changed, 165 insertions(+), 16 deletions(-)

-- 
2.15.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-22 23:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14 16:18 [bug#29296] [PATCH 0/2] gexp: Add 'let-system' Ludovic Courtès
2017-11-14 16:25 ` [bug#29296] [PATCH 1/2] gexp: Compilers can now return lowerable objects Ludovic Courtès
2017-11-14 16:25   ` [bug#29296] [PATCH 2/2] gexp: Add 'let-system' Ludovic Courtès
2017-11-15 11:27     ` Mathieu Othacehe
2017-11-16  9:10       ` Ludovic Courtès
2020-05-22 22:44         ` Danny Milosavljevic
2020-05-22 23:01           ` Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).