From: ludo@gnu.org (Ludovic Courtès)
To: Christopher Baines <mail@cbaines.net>
Cc: 28274-done@debbugs.gnu.org
Subject: bug#28274: [PATCH] gnu: Add fold-packages-in-modules.
Date: Fri, 01 Sep 2017 11:08:56 +0200 [thread overview]
Message-ID: <878thy7plj.fsf@gnu.org> (raw)
In-Reply-To: <20170831224433.07d6cea7@cbaines.net> (Christopher Baines's message of "Thu, 31 Aug 2017 22:44:33 +0100")
Christopher Baines <mail@cbaines.net> skribis:
> On Thu, 31 Aug 2017 15:20:55 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> Instead of introducing a new procedure, what about simply:
>>
>>
>> diff --git a/gnu/packages.scm b/gnu/packages.scm
>> index 562906178..b4ac6661c 100644
>> --- a/gnu/packages.scm
>> +++ b/gnu/packages.scm
>> @@ -140,17 +140,19 @@ for system '~a'")
>> directory))
>> %load-path)))
>>
>> -(define (fold-packages proc init)
>> - "Call (PROC PACKAGE RESULT) for each available package, using INIT
>> as -the initial value of RESULT. It is guaranteed to never traverse
>> the -same package twice."
>> +(define* (fold-packages proc init
>> + #:optional
>> + (modules (all-modules
>> (%package-module-path))))
>> + "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."
>> (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))
>>
>> (define find-packages-by-name
>> (let ((packages (delay
>>
>>
>> ?
>
> This looks great. Are you set to push it up, or shall I?
Pushed, thanks!
Ludo'.
next prev parent reply other threads:[~2017-09-01 9:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 7:07 [bug#28274] [PATCH] gnu: Add fold-packages-in-modules Christopher Baines
2017-08-31 13:20 ` Ludovic Courtès
2017-08-31 21:44 ` Christopher Baines
2017-09-01 9:08 ` Ludovic Courtès [this message]
2017-09-01 18:20 ` Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878thy7plj.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=28274-done@debbugs.gnu.org \
--cc=mail@cbaines.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.