diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-02-17 14:25:43 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-02-23 15:24:48 +0100 |
commit | b57de6fea126f907a873ae14ad8b32dc32456e8e (patch) | |
tree | a8db88484cab66eeb9ead5c6e4092278c5aebeb0 /guix | |
parent | a26006ff72746a49dde6d548a8687bf55e9d4d3a (diff) |
gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'.
* guix/gexp.scm (lower-inputs, gexp->sexp): Change keyword parameters to
positional parameters. Adjust callers accordingly.
* tests/gexp.scm (gexp->sexp*, "gexp->file"): Adjust accordingly.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/gexp.scm | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm index 6990d33651..943b336539 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -826,8 +826,7 @@ list." (one-of symbol? string? keyword? pair? null? array? number? boolean? char?))) -(define* (lower-inputs inputs - #:key system target) +(define (lower-inputs inputs system target) "Turn any object from INPUTS into a derivation input for SYSTEM or a store item (a \"source\"); return the corresponding input list as a monadic value. When TARGET is true, use it as the cross-compilation target triplet." @@ -874,8 +873,7 @@ corresponding <derivation-input> or store item." (match graphs (((file-names . inputs) ...) (mlet %store-monad ((inputs (lower-inputs (map tuple->gexp-input inputs) - #:system system - #:target target))) + system target))) (return (map cons file-names inputs)))))) (define* (lower-references lst #:key system target) @@ -1005,11 +1003,8 @@ derivations--e.g., code evaluated for its side effects." (return guile-for-build) (default-guile-derivation system))) (inputs (lower-inputs (gexp-inputs exp) - #:system system - #:target target)) - (sexp (gexp->sexp exp - #:system system - #:target target)) + system target)) + (sexp (gexp->sexp exp system target)) (extensions -> (gexp-extensions exp)) (exts (mapm %store-monad (lambda (obj) @@ -1278,9 +1273,7 @@ The other arguments are as for 'derivation'." (delete-duplicates (add-reference-output (gexp-references exp) '()))) -(define* (gexp->sexp exp #:key - (system (%current-system)) - (target (%current-target-system))) +(define (gexp->sexp exp system target) "Return (monadically) the sexp corresponding to EXP for the given OUTPUT, and in the current monad setting (system type, etc.)" (define* (reference->sexp ref #:optional native?) @@ -1293,8 +1286,7 @@ and in the current monad setting (system type, etc.)" (return `((@ (guile) getenv) ,output))) (($ <gexp-input> (? gexp? exp) output n?) (gexp->sexp exp - #:system system - #:target (if (or n? native?) #f target))) + system (if (or n? native?) #f target))) (($ <gexp-input> (refs ...) output n?) (mapm %store-monad (lambda (ref) |