Browse Source
packages: 'fold-packages' takes #:select? parameter.
* gnu/packages.scm (fold-packages): Add #:select? parameter and honor it.
version-0.14.0
Ludovic Courtès
5 years ago
No known key found for this signature in database
GPG Key ID: 90B11993D9AEBB5
1 changed files with
5 additions and
5 deletions
-
gnu/packages.scm
|
|
@ -142,13 +142,13 @@ for system '~a'") |
|
|
|
|
|
|
|
(define* (fold-packages proc init |
|
|
|
#:optional |
|
|
|
(modules (all-modules (%package-module-path)))) |
|
|
|
(modules (all-modules (%package-module-path))) |
|
|
|
#:key (select? (negate hidden-package?))) |
|
|
|
"Call (PROC PACKAGE RESULT) for each available package defined in one of |
|
|
|
MODULES, using INIT as the initial value of RESULT. It is guaranteed to never |
|
|
|
traverse the same package twice." |
|
|
|
MODULES that matches SELECT?, using INIT as the initial value of RESULT. It |
|
|
|
is guaranteed to never traverse the same package twice." |
|
|
|
(fold-module-public-variables (lambda (object result) |
|
|
|
(if (and (package? object) |
|
|
|
(not (hidden-package? object))) |
|
|
|
(if (and (package? object) (select? object)) |
|
|
|
(proc object result) |
|
|
|
result)) |
|
|
|
init |
|
|
|