diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-11-05 23:46:55 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-11-05 23:50:57 +0100 |
commit | 0af2c24ef788bffbdb30b4662d15fcd194a51e48 (patch) | |
tree | 7f76abb82fe1a2662cf922d1843bbac945ddecb7 /distro | |
parent | a48dddfe9cf19b9c301ca170eacc05604b5cefac (diff) | |
download | gnu-guix-0af2c24ef788bffbdb30b4662d15fcd194a51e48.tar gnu-guix-0af2c24ef788bffbdb30b4662d15fcd194a51e48.tar.gz |
utils: Add `default-keyword-arguments' and `substitute-keyword-arguments'.
* distro/packages/base.scm (default-keyword-arguments,
substitute-keyword-arguments): Move to...
* guix/utils.scm: ... here.
Diffstat (limited to 'distro')
-rw-r--r-- | distro/packages/base.scm | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/distro/packages/base.scm b/distro/packages/base.scm index 3f79449250..195f870676 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -564,37 +564,6 @@ with the Linux kernel.") ;;; Bootstrap packages. ;;; -(define (default-keyword-arguments args defaults) - "Return ARGS augmented with any keyword/value from DEFAULTS for -keywords not already present in ARGS." - (let loop ((defaults defaults) - (args args)) - (match defaults - ((kw value rest ...) - (loop rest - (if (assoc-ref kw args) - args - (cons* kw value args)))) - (() - args)))) - -(define-syntax substitute-keyword-arguments - (syntax-rules () - "Return a new list of arguments where the value for keyword arg KW is -replaced by EXP. EXP is evaluated in a context where VAR is boud to the -previous value of the keyword argument." - ((_ original-args ((kw var) exp) ...) - (let loop ((args original-args) - (before '())) - (match args - ((kw var rest (... ...)) - (loop rest (cons* exp kw before))) - ... - ((x rest (... ...)) - (loop rest (cons x before))) - (() - (reverse before))))))) - (define gnu-make-boot0 (package-with-bootstrap-guile (package (inherit gnu-make) |