diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-12-20 18:39:04 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-12-20 18:39:04 +0100 |
commit | 86974d8a9247cbeb938b5202f23ccca8d9ed627d (patch) | |
tree | 7bd498ccf672aced617aa24a830ec4164268c03f /guix/packages.scm | |
parent | 03a45a40227d97ccafeb49c4eb0fc7539f4d2127 (diff) | |
parent | 9012d226fa46229a84e49a42c9b6d287105dfddf (diff) | |
download | guix-patches-86974d8a9247cbeb938b5202f23ccca8d9ed627d.tar guix-patches-86974d8a9247cbeb938b5202f23ccca8d9ed627d.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/packages.scm')
-rw-r--r-- | guix/packages.scm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index eab0b3404c..e4c2ac3be5 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -870,14 +870,14 @@ OVERRIDES." SYSTEM." ;; FIXME: This memoization should be associated with the open store, because ;; otherwise it breaks when switching to a different store. - (let ((vals (call-with-values thunk list))) + (let ((result (thunk))) ;; Use `hashq-set!' instead of `hash-set!' because `hash' returns the ;; same value for all structs (as of Guile 2.0.6), and because pointer ;; equality is sufficient in practice. (hashq-set! cache package - `((,system ,@vals) + `((,system . ,result) ,@(or (hashq-ref cache package) '()))) - (apply values vals))) + result)) (define-syntax cached (syntax-rules (=>) @@ -889,10 +889,8 @@ Return the cached result when available." (match (hashq-ref cache package) ((alist (... ...)) (match (assoc-ref alist key) - ((vals (... ...)) - (apply values vals)) - (#f - (cache! cache package key thunk)))) + (#f (cache! cache package key thunk)) + (value value))) (#f (cache! cache package key thunk))))) ((_ package system body ...) |