GNU bug report logs -
#29296
[PATCH 0/2] gexp: Add 'let-system'
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Tue, 14 Nov 2017 16:20:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 5 years and 96 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.