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) | |
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 ec2473422f4..0aa289d56c0 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm | |||
| @@ -235,28 +235,27 @@ decreasing version order." | |||
| 235 | matching))))) | 235 | matching))))) |
| 236 | 236 | ||
| 237 | (define find-newest-available-packages | 237 | (define find-newest-available-packages |
| 238 | (memoize | 238 | (mlambda () |
| 239 | (lambda () | 239 | "Return a vhash keyed by package names, and with |
| 240 | "Return a vhash keyed by package names, and with | ||
| 241 | associated values of the form | 240 | associated values of the form |
| 242 | 241 | ||
| 243 | (newest-version newest-package ...) | 242 | (newest-version newest-package ...) |
| 244 | 243 | ||
| 245 | where the preferred package is listed first." | 244 | where the preferred package is listed first." |
| 246 | 245 | ||
| 247 | ;; FIXME: Currently, the preferred package is whichever one | 246 | ;; FIXME: Currently, the preferred package is whichever one |
| 248 | ;; was found last by 'fold-packages'. Find a better solution. | 247 | ;; was found last by 'fold-packages'. Find a better solution. |
| 249 | (fold-packages (lambda (p r) | 248 | (fold-packages (lambda (p r) |
| 250 | (let ((name (package-name p)) | 249 | (let ((name (package-name p)) |
| 251 | (version (package-version p))) | 250 | (version (package-version p))) |
| 252 | (match (vhash-assoc name r) | 251 | (match (vhash-assoc name r) |
| 253 | ((_ newest-so-far . pkgs) | 252 | ((_ newest-so-far . pkgs) |
| 254 | (case (version-compare version newest-so-far) | 253 | (case (version-compare version newest-so-far) |
| 255 | ((>) (vhash-cons name `(,version ,p) r)) | 254 | ((>) (vhash-cons name `(,version ,p) r)) |
| 256 | ((=) (vhash-cons name `(,version ,p ,@pkgs) r)) | 255 | ((=) (vhash-cons name `(,version ,p ,@pkgs) r)) |
| 257 | ((<) r))) | 256 | ((<) r))) |
| 258 | (#f (vhash-cons name `(,version ,p) r))))) | 257 | (#f (vhash-cons name `(,version ,p) r))))) |
| 259 | vlist-null)))) | 258 | vlist-null))) |
| 260 | 259 | ||
| 261 | (define (find-best-packages-by-name name version) | 260 | (define (find-best-packages-by-name name version) |
| 262 | "If version is #f, return the list of packages named NAME with the highest | 261 | "If version is #f, return the list of packages named NAME with the highest |
