diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-01-28 17:09:34 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-01-28 18:55:20 +0100 |
commit | 55b2d921456e888f097bf4e43a3d25b112f3e563 (patch) | |
tree | 5e2e834a2aa37f50dd27a33ae38a2f82c30091a7 /gnu/packages.scm | |
parent | f9704f179a5160013c4a401dce3761714bba8e72 (diff) | |
download | guix-55b2d921456e888f097bf4e43a3d25b112f3e563.tar.gz |
Use 'mlambda' instead of 'memoize'.
* gnu/packages.scm (find-newest-available-packages): Use 'mlambda' instead of (memoize (lambda ...) ...). * gnu/packages/bootstrap.scm (package-with-bootstrap-guile): Likewise. * guix/build-system/gnu.scm (package-with-explicit-inputs)[rewritten-input]: Likewise. * guix/build-system/python.scm (package-with-explicit-python)[transform]: Likewise. * guix/derivations.scm (derivation->string): Likewise. * guix/gnu-maintenance.scm (gnu-package?): Likewise. * guix/modules.scm (module-file-dependencies): Likewise. * guix/scripts/graph.scm (standard-package-set): Likewise. * guix/scripts/lint.scm (official-gnu-packages*): Likewise. * guix/store.scm (store-regexp*): Likewise. * guix/utils.scm (location): Likewise.
Diffstat (limited to 'gnu/packages.scm')
-rw-r--r-- | gnu/packages.scm | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm index ec2473422f..0aa289d56c 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -235,28 +235,27 @@ decreasing version order." matching))))) (define find-newest-available-packages - (memoize - (lambda () - "Return a vhash keyed by package names, and with + (mlambda () + "Return a vhash keyed by package names, and with associated values of the form (newest-version newest-package ...) where the preferred package is listed first." - ;; FIXME: Currently, the preferred package is whichever one - ;; was found last by 'fold-packages'. Find a better solution. - (fold-packages (lambda (p r) - (let ((name (package-name p)) - (version (package-version p))) - (match (vhash-assoc name r) - ((_ newest-so-far . pkgs) - (case (version-compare version newest-so-far) - ((>) (vhash-cons name `(,version ,p) r)) - ((=) (vhash-cons name `(,version ,p ,@pkgs) r)) - ((<) r))) - (#f (vhash-cons name `(,version ,p) r))))) - vlist-null)))) + ;; FIXME: Currently, the preferred package is whichever one + ;; was found last by 'fold-packages'. Find a better solution. + (fold-packages (lambda (p r) + (let ((name (package-name p)) + (version (package-version p))) + (match (vhash-assoc name r) + ((_ newest-so-far . pkgs) + (case (version-compare version newest-so-far) + ((>) (vhash-cons name `(,version ,p) r)) + ((=) (vhash-cons name `(,version ,p ,@pkgs) r)) + ((<) r))) + (#f (vhash-cons name `(,version ,p) r))))) + vlist-null))) (define (find-best-packages-by-name name version) "If version is #f, return the list of packages named NAME with the highest |