diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-09-04 22:34:28 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-09-04 22:34:28 +0200 |
commit | a76585e5535f433d37c0900cf0b2d3c9d3b3461c (patch) | |
tree | 007befec20e2a33117256eeee11b7c642179dad4 /guix/memoization.scm | |
parent | 1dc32c2961402c946c25e5a1aabe79a30cce3cff (diff) | |
parent | c427fda233a7da0c8eb27e244a562c51d3835503 (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'guix/memoization.scm')
-rw-r--r-- | guix/memoization.scm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/memoization.scm b/guix/memoization.scm index 5cae283610..bf3b73d806 100644 --- a/guix/memoization.scm +++ b/guix/memoization.scm @@ -76,10 +76,11 @@ the result is returned via (apply values results)." exactly one value." ((_ cached () body ...) ;; The zero-argument case is equivalent to a promise. - (let ((result #f) (cached? #f)) + (let ((result #f) (cached? #f) + (compute (lambda () body ...))) (lambda () (unless cached? - (set! result (begin body ...)) + (set! result (compute)) (set! cached? #t)) result))) |