all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 28274@debbugs.gnu.org
Subject: [bug#28274] [PATCH] gnu: Add fold-packages-in-modules.
Date: Fri, 1 Sep 2017 19:20:26 +0100	[thread overview]
Message-ID: <20170901192026.42c484e7@cbaines.net> (raw)
In-Reply-To: <878thy7plj.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1863 bytes --]

On Fri, 01 Sep 2017 11:08:56 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> 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!

Awesome, thanks Ludo :)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

      reply	other threads:[~2017-09-01 18:21 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     ` bug#28274: " Ludovic Courtès
2017-09-01 18:20       ` Christopher Baines [this message]

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=20170901192026.42c484e7@cbaines.net \
    --to=mail@cbaines.net \
    --cc=28274@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /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.