Christopher Baines skribis: > Add a more flexible variant of the fold-packages procedure, that takes a list > of the modules to work with. The existing fold-packages procedure then calls > fold-packages-in-modules with the result of the all-modules procedure. > > I wrote this when looking at how to get the packages in a specific set of > modules, to create jobs for cuirass. > > * gnu/packages.scm (fold-packages-in-modules): New procedure. > (fold-packages): Change to use fold-packages-in-modules. [...] > +(define (fold-packages-in-modules modules proc init) > + "Call (PROC PACKAGE RESULT) for each available package within any of the > +modules in MODULES, 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))) > (proc object result) > result)) > init > - (all-modules (%package-module-path)))) > + modules)) Instead of introducing a new procedure, what about simply: