civodul pushed a commit to branch wip-build-systems-gexp in repository guix.
commit 0b64b8c6b3338ecaa03bb46f236f105dc922f411 Author: Ludovic Courtès <[email protected]> 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." 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 (=>)
