From patchwork Mon Jun 1 00:11:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 22489 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F363827BBE4; Mon, 1 Jun 2020 01:12:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5727627BBE3 for ; Mon, 1 Jun 2020 01:12:08 +0100 (BST) Received: from localhost ([::1]:38774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfY3j-0004cT-Tn for patchwork@mira.cbaines.net; Sun, 31 May 2020 20:12:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfY3f-0004c8-2u for guix-patches@gnu.org; Sun, 31 May 2020 20:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfY3e-0001Hx-P5 for guix-patches@gnu.org; Sun, 31 May 2020 20:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfY3e-0003qd-Ka for guix-patches@gnu.org; Sun, 31 May 2020 20:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41636] [PATCH] combinators: Recurse fold2 to named let loop. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Jun 2020 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41636 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41636@debbugs.gnu.org Cc: Arun Isaac X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159097028714746 (code B ref -1); Mon, 01 Jun 2020 00:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jun 2020 00:11:27 +0000 Received: from localhost ([127.0.0.1]:34139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfY34-0003pl-Qr for submit@debbugs.gnu.org; Sun, 31 May 2020 20:11:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:41094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfY32-0003pe-VJ for submit@debbugs.gnu.org; Sun, 31 May 2020 20:11:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfY32-0004Zc-Q8 for guix-patches@gnu.org; Sun, 31 May 2020 20:11:24 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:53328) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfY2z-0000ow-8u for guix-patches@gnu.org; Sun, 31 May 2020 20:11:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VyQNdAZcUHsMhOsUU9DXxTnoYrzc9I0TyibJbpGuf+Q=; b=dfVxLfed8xihUqmAJi9W8HXWHx p4SXWNfAwscac4petuW/ebi6lZbvA2SKmOsOrviNo4qyWF2PiRQwI37zkRda08Pmm74xVwd2SzKeU rnarEu59YbgHw/J1lCVEy6st0cpQg8l2m3Ng3ScAb4DKjOjjQ22YZe+iuZ6ZrDYvT7UE=; Received: from [192.168.2.1] (helo=steel.lan) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jfY2t-000Zlo-EE; Mon, 01 Jun 2020 05:41:15 +0530 From: Arun Isaac Date: Mon, 1 Jun 2020 05:41:13 +0530 Message-Id: <20200601001113.10439-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Received-SPF: pass client-ip=139.59.75.54; envelope-from=arunisaac@systemreboot.net; helo=mugam.systemreboot.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/31 20:00:35 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/combinators.scm (fold2): Recurse to named let loop, not fold2 itself. --- guix/combinators.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ;;; Copyright © 2014 Eric Bavier +;;; Copyright © 2020 Arun Isaac ;;; ;;; 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