From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 03:07:37 2017 Received: (at submit) by debbugs.gnu.org; 29 Aug 2017 07:07:37 +0000 Received: from localhost ([127.0.0.1]:60068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmacb-0003IF-6s for submit@debbugs.gnu.org; Tue, 29 Aug 2017 03:07:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmacZ-0003I3-T6 for submit@debbugs.gnu.org; Tue, 29 Aug 2017 03:07:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmacT-00068k-Km for submit@debbugs.gnu.org; Tue, 29 Aug 2017 03:07:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38029) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmacT-00068b-HY for submit@debbugs.gnu.org; Tue, 29 Aug 2017 03:07:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmacS-0001tJ-Hj for guix-patches@gnu.org; Tue, 29 Aug 2017 03:07:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmacP-00066o-Cz for guix-patches@gnu.org; Tue, 29 Aug 2017 03:07:28 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:39461 helo=mira.cbaines.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmacP-00066L-7I for guix-patches@gnu.org; Tue, 29 Aug 2017 03:07:25 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id D61F613D262; Tue, 29 Aug 2017 08:07:23 +0100 (BST) Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id AECCF13D261 for ; Tue, 29 Aug 2017 08:07:23 +0100 (BST) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 45ffff0a for ; Tue, 29 Aug 2017 07:07:23 +0000 (UTC) From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH] gnu: Add fold-packages-in-modules. Date: Tue, 29 Aug 2017 08:07:23 +0100 Message-Id: <20170829070723.21727-1-mail@cbaines.net> X-Mailer: git-send-email 2.14.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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. --- gnu/packages.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gnu/packages.scm b/gnu/packages.scm index 562906178..3f0ff56b8 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -47,6 +47,7 @@ %bootstrap-binaries-path %package-module-path + fold-packages-in-modules fold-packages find-packages-by-name @@ -144,13 +145,21 @@ for system '~a'") "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." + (fold-packages-in-modules (all-modules (%package-module-path)) + proc + init)) + +(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)) (define find-packages-by-name (let ((packages (delay -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 09:21:08 2017 Received: (at 28274) by debbugs.gnu.org; 31 Aug 2017 13:21:08 +0000 Received: from localhost ([127.0.0.1]:36527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnPPA-0000kH-L8 for submit@debbugs.gnu.org; Thu, 31 Aug 2017 09:21:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnPP8-0000jN-MF for 28274@debbugs.gnu.org; Thu, 31 Aug 2017 09:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnPOz-0002m2-MF for 28274@debbugs.gnu.org; Thu, 31 Aug 2017 09:21:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnPOz-0002lp-IQ; Thu, 31 Aug 2017 09:20:57 -0400 Received: from [193.50.110.184] (port=46334 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dnPOz-0008HX-6F; Thu, 31 Aug 2017 09:20:57 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Christopher Baines Subject: Re: [bug#28274] [PATCH] gnu: Add fold-packages-in-modules. References: <20170829070723.21727-1-mail@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 Fructidor an 225 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 31 Aug 2017 15:20:55 +0200 In-Reply-To: <20170829070723.21727-1-mail@cbaines.net> (Christopher Baines's message of "Tue, 29 Aug 2017 08:07:23 +0100") Message-ID: <87r2vrrhzc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28274 Cc: 28274@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQo/DQoNCkx1ZG/igJkuDQo= --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 17:44:43 2017 Received: (at 28274) by debbugs.gnu.org; 31 Aug 2017 21:44:43 +0000 Received: from localhost ([127.0.0.1]:38229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnXGU-0003XZ-PQ for submit@debbugs.gnu.org; Thu, 31 Aug 2017 17:44:42 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:42395 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnXGS-0003XQ-Hh for 28274@debbugs.gnu.org; Thu, 31 Aug 2017 17:44:40 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 1174C13D289; Thu, 31 Aug 2017 22:44:40 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 14F7613D286; Thu, 31 Aug 2017 22:44:34 +0100 (BST) Date: Thu, 31 Aug 2017 22:44:33 +0100 From: Christopher Baines To: ludo@gnu.org (Ludovic =?UTF-8?B?Q291cnTDqHM=?=) Subject: Re: [bug#28274] [PATCH] gnu: Add fold-packages-in-modules. Message-ID: <20170831224433.07d6cea7@cbaines.net> In-Reply-To: <87r2vrrhzc.fsf@gnu.org> References: <20170829070723.21727-1-mail@cbaines.net> <87r2vrrhzc.fsf@gnu.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/U/hs55KAojnvzsHYhhbptvZ"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28274 Cc: 28274@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Sig_/U/hs55KAojnvzsHYhhbptvZ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 31 Aug 2017 15:20:55 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Instead of introducing a new procedure, what about simply: >=20 >=20 > 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))) > =20 > -(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)) > =20 > (define find-packages-by-name > (let ((packages (delay >=20 >=20 > ? This looks great. Are you set to push it up, or shall I? Thanks, Chris --Sig_/U/hs55KAojnvzsHYhhbptvZ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmog0FfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XeZ9xAAtXKdELZxEjZRJLDB7Bxn+TllgupG0u2OEk9Pf6V3ibAAK8OzxBOjJxCy hgmyKPYSGd3pLWJ2nvZWw02GeKqFJgqWH//ZUgjmv6kP/ZUHHGo6duRrd1seeS9X hTspotXPiJDNzA42J4E/oesKk5nShcc7BkSwGnoExp7RYhqG0/OLm6dTLSCxhwV3 2LWoUtmSPInDGAL62uS8bbzoECbizy+gGg/NbGeGG4593JvvV9bI03A5TCG3LDvQ KK8AZg7vuYAWmcJdzSi1zV5zXCUl4wzzRUV8ZaewNTNdIv7lkI8WYeqQ03ukinHJ kQ9TsVYWxOH3go/YIhox4rDQxqEiAQsoj25xQC43ktPJ3O/Eu+yT4RsLFMPNmFq7 fXgYyj9CWd2UFBWvAbWpELC/WBMzYmElR/SV8ehkU14/C38QK3BWzyHrlR/IoJHI t8Vtlz4YEF6exFBUlzWi2TfzvPzVGRUtnWewK//iDCwr8V9PZ1690Le3flqDToUW z+sj8Y1zkMtP6hXzSn8dugOvSIsqi83iM3z+zvUm5fAz3yeJgyEvHLi4ojFZpOfG NfAe7ik/Qx6wcXW7yaVLjEYJYv/4EBru+XChqB7oPcWNzOCnyodeI8OQrTi7io/S hZVeeC7elWd7QIJvQGvJO/KrvyFhbBNFDHKI155morysm5YgbMs= =01Vu -----END PGP SIGNATURE----- --Sig_/U/hs55KAojnvzsHYhhbptvZ-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 05:09:10 2017 Received: (at 28274-done) by debbugs.gnu.org; 1 Sep 2017 09:09:10 +0000 Received: from localhost ([127.0.0.1]:39065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnhwr-0004z1-SK for submit@debbugs.gnu.org; Fri, 01 Sep 2017 05:09:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnhwq-0004ym-Ny for 28274-done@debbugs.gnu.org; Fri, 01 Sep 2017 05:09:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnhwg-0003zh-QH for 28274-done@debbugs.gnu.org; Fri, 01 Sep 2017 05:09:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnhwg-0003zd-My; Fri, 01 Sep 2017 05:08:58 -0400 Received: from [193.50.110.184] (port=34644 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dnhwg-0006E2-AO; Fri, 01 Sep 2017 05:08:58 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Christopher Baines Subject: Re: [bug#28274] [PATCH] gnu: Add fold-packages-in-modules. References: <20170829070723.21727-1-mail@cbaines.net> <87r2vrrhzc.fsf@gnu.org> <20170831224433.07d6cea7@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 Fructidor an 225 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Fri, 01 Sep 2017 11:08:56 +0200 In-Reply-To: <20170831224433.07d6cea7@cbaines.net> (Christopher Baines's message of "Thu, 31 Aug 2017 22:44:33 +0100") Message-ID: <878thy7plj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28274-done Cc: 28274-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Christopher Baines skribis: > On Thu, 31 Aug 2017 15:20:55 +0200 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > >> Instead of introducing a new procedure, what about simply: >>=20 >>=20 >> 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))) >>=20=20 >> -(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)) >>=20=20 >> (define find-packages-by-name >> (let ((packages (delay >>=20 >>=20 >> ? > > This looks great. Are you set to push it up, or shall I? Pushed, thanks! Ludo'. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 14:20:35 2017 Received: (at 28274) by debbugs.gnu.org; 1 Sep 2017 18:20:35 +0000 Received: from localhost ([127.0.0.1]:40548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnqYT-00058H-84 for submit@debbugs.gnu.org; Fri, 01 Sep 2017 14:20:35 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:43177 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnqYR-00058A-Q2 for 28274@debbugs.gnu.org; Fri, 01 Sep 2017 14:20:32 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id E4D8013D297; Fri, 1 Sep 2017 19:20:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id CAC7013D295; Fri, 1 Sep 2017 19:20:29 +0100 (BST) Date: Fri, 1 Sep 2017 19:20:26 +0100 From: Christopher Baines To: ludo@gnu.org (Ludovic =?UTF-8?B?Q291cnTDqHM=?=) Subject: Re: [bug#28274] [PATCH] gnu: Add fold-packages-in-modules. Message-ID: <20170901192026.42c484e7@cbaines.net> In-Reply-To: <878thy7plj.fsf@gnu.org> References: <20170829070723.21727-1-mail@cbaines.net> <87r2vrrhzc.fsf@gnu.org> <20170831224433.07d6cea7@cbaines.net> <878thy7plj.fsf@gnu.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/KAnwl=Z9Ev6TE3ZRig1KcXf"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28274 Cc: 28274@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Sig_/KAnwl=Z9Ev6TE3ZRig1KcXf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 01 Sep 2017 11:08:56 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Christopher Baines skribis: >=20 > > On Thu, 31 Aug 2017 15:20:55 +0200 > > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > > =20 > >> Instead of introducing a new procedure, what about simply: > >>=20 > >>=20 > >> 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))) > >> =20 > >> -(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)) > >> =20 > >> (define find-packages-by-name > >> (let ((packages (delay > >>=20 > >>=20 > >> ? =20 > > > > This looks great. Are you set to push it up, or shall I? =20 >=20 > Pushed, thanks! Awesome, thanks Ludo :) --Sig_/KAnwl=Z9Ev6TE3ZRig1KcXf Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmppOpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xc3nA//eexqSk7y7Mdb3lRKXS+q+KY3x/UBquC7SuVOc+RE501x8uH56iGsmxPd FqxkFM43Yd1InIuz6IE5tp8TWFFoAr5nbJdniJc9yC1MG04BysRFfrjMhHjI8ESo 4a2/URSz2H2Vt3GQQnM9HP0YRAh66P4nVVQtXAO2+LkmS6itog9V9+uMQQ3krjDX 8tFwWOhWYK0u3nZEF/99eqbr3aQ+e8zLwDShfr0bveDmyv0MrJFrc+Uli6ErcfNC DEaaIWwhtEo9nsNSdbFf0S5jPrLy7824fF9OSOLFQp1iiodHnao3rDQFEI93Ignw Q3cZpT7lA1Cv2x4w77Zbr+kTAmHt1acNkH3YdbgGkmmrqVPjhhaDzuLsv/DBaxUH ZpES+0qKt/tJ4iZJgCzFJewLmWG/oeijLoQiJUDB53PH/2QTriN7zunPunLSyYFz k40chWBB02x4a9DGK8htb6z1cOCas9qb+JbMBCZ5D7U/0ixpzgfy7IY6BilGA+Sk l7kfPld/j3LXFC17okL4lrDMp56Znuh5fEUOgnvC/MlQSKVqYOxJu9Y0bL9sMH8d GyC2aWsqpfcYTtWK8Gj/2TMy9ojZkoHI9raC5qnz5RmSc8kfjuOdxD6hzXgEwf3T CPsyuwCTraqC1FKcokBhV2dSKrUjpvfXqow8/D3+hx94NzKiLuw= =ak2u -----END PGP SIGNATURE----- --Sig_/KAnwl=Z9Ev6TE3ZRig1KcXf-- From unknown Thu Sep 11 20:11:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 Sep 2017 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator