[PATCH] combinators: Recurse fold2 to named let loop.

DoneSubmitted by Arun Isaac.
Details
2 participants
  • Arun Isaac
  • Jakub Kądziołka
Owner
unassigned
Severity
normal
A
A
Arun Isaac wrote on 1 Jun 2020 02:11
(address . guix-patches@gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20200601001113.10439-1-arunisaac@systemreboot.net
* guix/combinators.scm (fold2): Recurse to named let loop, not fold2 itself.
---
guix/combinators.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (23 lines)
diff --git a/guix/combinators.scm b/guix/combinators.scm
index 11cad62ccf..4707b59363 100644
--- a/guix/combinators.scm
+++ b/guix/combinators.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -56,7 +57,7 @@
            (call-with-values
                (lambda () (proc (car lst1) (car lst2) result1 result2))
              (lambda (result1 result2)
-               (fold2 proc result1 result2 (cdr lst1) (cdr lst2)))))))))
+               (loop result1 result2 (cdr lst1) (cdr lst2)))))))))
 
 (define (fold-tree proc init children roots)
   "Call (PROC NODE RESULT) for each node in the tree that is reachable from
-- 
2.26.2
J
J
Jakub Kądziołka wrote on 1 Jun 2020 14:58
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 41636-done@debbugs.gnu.org)
20200601125826.2m7xnnzy2kogvbo7@gravity
On Mon, Jun 01, 2020 at 05:41:13AM +0530, Arun Isaac wrote:
Toggle quote (5 lines)
> * guix/combinators.scm (fold2): Recurse to named let loop, not fold2 itself.
> ---
> guix/combinators.scm | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks for the patch! I agree that this is better for consistency, thus
I have pushed your patch as commit 7a99c58c4597a550703f32018efafb0fe84d5c72.

Cheers!
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl7U+3IACgkQ4xWnWEYT
FWSgxRAAlgxzYqL1eReWjMlesKyEEWy5DeCrW3PPpXrcBZBGVVc44+4dmdlBVLOz
voxbIzhkMp3Hvie9h6A5t+eEfW1DzasQbP2ozNxjZL0/vUDyqcTfrNvX3wauonaw
SEHDbOgFm1RvULpmLnVQvH804asJYkWuYUX8xwlN8er6C9JRxDKVuw7UENSdkhtf
RfGJ4h8UjE9QoItTH2Duy436tTOYxDE2UuWK4aFsEfL0rtpVB1IOVlOktBe8ENak
F0NP3iFDlQfcRum0ZUSYGpJlWELFnJrE3+9JmrWWmU8wvuo11/J8tgsyRqQI4Lsp
EE+CeO0SDFva+lZwsCz8XtixLexyzyVXB1KpwP0YDd37Yj4q/u9p/IIB6ELr47Mm
C8KpUWTC+7kb8bQBEN6V3xrpLTaAWR8rAglr/Dt+Oz+V1R9rOnVETvPSFr032IvX
KTvcEqAtOp10fYm2Ei6Pf5zhnGXGKYsC/yRjgTbCxyzPSlP1kZjW/iIoH2GqIdow
7qQIy7lc03k0j0iSuotjIRasCHOwX1+CRyfci+6KIGtnsafVslTMJlGg+62Oq885
Aas+pMESqU8Qm/mVLmmdfdlK7DzoYwYvkw91pQb/M5eiTnZ9XadUpfz4PEbPOt5+
/opo/iYh9jVlTuM7toquUr/REDKPot1qIqP3xSEV92JycEdkBnI=
=M7Xd
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 41636@debbugs.gnu.org