[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

11/16: packages: Turn 'cache!' into a single-value-return cache.

From: Ludovic Courtès
Subject: 11/16: packages: Turn 'cache!' into a single-value-return cache.
Date: Wed, 28 Jun 2017 17:48:55 -0400 (EDT)

civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.

commit 6a8726927c8d471ea3def3effc834bf6f9b77947
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jun 25 16:31:33 2017 +0200

    packages: Turn 'cache!' into a single-value-return cache.
    * guix/packages.scm (cache!): Assume THUNK returns a single value.
 guix/packages.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 3621cfe..36c5884 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -819,14 +819,14 @@ OVERRIDES."
   ;; 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 (=>)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]