From unknown Sun Sep 07 01:26:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24080 <24080@debbugs.gnu.org> To: bug#24080 <24080@debbugs.gnu.org> Subject: Status: fold-left description in (rnrs lists) section of guile manual incorrect Reply-To: bug#24080 <24080@debbugs.gnu.org> Date: Sun, 07 Sep 2025 08:26:10 +0000 retitle 24080 fold-left description in (rnrs lists) section of guile manual= incorrect reassign 24080 guile submitter 24080 "Glenn Michaels" severity 24080 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 26 16:15:30 2016 Received: (at submit) by debbugs.gnu.org; 26 Jul 2016 20:15:30 +0000 Received: from localhost ([127.0.0.1]:38480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bS8lG-0006gl-I8 for submit@debbugs.gnu.org; Tue, 26 Jul 2016 16:15:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bS8lE-0006gX-Mk for submit@debbugs.gnu.org; Tue, 26 Jul 2016 16:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS8l8-0003lX-N3 for submit@debbugs.gnu.org; Tue, 26 Jul 2016 16:15:23 -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.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, MIME_QP_LONG_LINE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS8l8-0003ko-Jx for submit@debbugs.gnu.org; Tue, 26 Jul 2016 16:15:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS8l6-0007en-IE for bug-guile@gnu.org; Tue, 26 Jul 2016 16:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS8l2-0003j9-Ck for bug-guile@gnu.org; Tue, 26 Jul 2016 16:15:19 -0400 Received: from orange.safe-mail.net ([212.29.227.81]:42600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS8l2-0003c0-4q for bug-guile@gnu.org; Tue, 26 Jul 2016 16:15:16 -0400 Received: by orange.safe-mail.net with Safe-mail (Exim 4.84) (envelope-from ) id 1bS8kt-0000mF-3I for bug-guile@gnu.org; Tue, 26 Jul 2016 16:15:07 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=N1-0105; d=Safe-mail.net; b=haC9cfqjSgUtnyAHmW+c4e2sR4dVF7MwdfqaadYFInYbf7Xemh2jLPcEqF563QOS hiK4fhrOMFPk1nbOfyoumQCfL1ObuPtJq0zVBGGL0KGWwsEa7p5loU+jsfUT0UEa rzcOcmmVM4B7QGcRayFV5wfepcexIt+N+iudM8pOahI=; Received: from pc ([109.163.234.7]) by Safe-mail.net with https Subject: fold-left description in (rnrs lists) section of guile manual incorrect Date: Tue, 26 Jul 2016 16:15:06 -0400 From: "Glenn Michaels" To: bug-guile@gnu.org X-SMType: Regular X-SMRef: N1O-eb0NN-SBT9 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SMSignature: FYkevCc1VSLa7ZWar6F5GE7cK/RD/LpItsm1896x6NIGXHcNg7g6PMZwoRN+vWFR vNtLoSqmBf0lljS3ajYuOwkwyhovWBXGpnb3LPWhLfxHPvHgrwFs+S/hSMLmolag so4VqzZFFZULVn2nqh2Zi6b7Ul3wNzIt+CEdTB555DM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.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: -5.0 (-----) The section on the (rnrs lists) library in the guile manual contains the following: Scheme Procedure: fold-left combine nil list1 list2 =E2=80=A6 Scheme Procedure: fold-right combine nil list1 list2 =E2=80=A6 These procedures are identical to the fold and fold-right procedures provided = by SRFI-1. In the case of fold-left and SRFI-1 fold, this is not correct; the order in = which the arguments are passed to the combine procedure is different. Compare: (let ((f (lambda (a b) (format #f "(f ~a ~a)" a b)))) (for-each (lambda (fold) (display (fold f "0" '(a b c d e))) (format #t " ; ~s\n" (procedure-name fold)) ) (list (@ (rnrs lists) fold-left) (@ (rnrs lists) fold-right) ;same as srfi-1 fold-right (@ (srfi srfi-1) fold) (@ (srfi srfi-1) fold-right)))) Output: (f (f (f (f (f 0 a) b) c) d) e) ; fold-left (f a (f b (f c (f d (f e 0))))) ; fold-right (f e (f d (f c (f b (f a 0))))) ; fold (f a (f b (f c (f d (f e 0))))) ; fold-right In the single-list case, fold-left can be thought of as applying f left-associatively = to the elements of the list. Moreover, in this case (fold f nil l) =3D=3D (fold-left (lambda (x y) (f y = x)) nil l). (In the case of fold-right, both versions are identical). From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 04 16:40:36 2016 Received: (at 24080-done) by debbugs.gnu.org; 4 Aug 2016 20:40:37 +0000 Received: from localhost ([127.0.0.1]:55896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVPRU-0002tH-Nw for submit@debbugs.gnu.org; Thu, 04 Aug 2016 16:40:36 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:58363 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVPRS-0002t9-SS for 24080-done@debbugs.gnu.org; Thu, 04 Aug 2016 16:40:35 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 749242EA46; Thu, 4 Aug 2016 16:40:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=iWSzXFA9CMqG LV0n7Y/4YvZ4p5U=; b=R507/C6u7BdvM3JNF5O8Bf+mpXGWM8wY6eDXOHEk4lnU E4Dfmd2Xj3y7ZXfKFhaj694f4+u8HG77/FJG4a4HWCVnF1ufEPLcpll6eI3Fi4RQ 6+wAlKDXjVmgxqmYv/mSqvOootj0riXsboRiw/e2B0ECqBQoN3v9jVmSiGPk9kI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=SKbAyi OSOzZEg1AmRQ6jpKemgGJhQkOMM2h8FkY78hSrmAriwyLT5jlbDovmHIIOjSoUAa ppBk2C7A/VnGCffgoPZ63YdfRCj/uZzSp+AHw1EvMJhNgIDDufxbwH7+ixQ1p9CI lk3igOL5VCh8nv2jt2jdaLk7iTqoEPaqze6yE= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 56C1C2EA44; Thu, 4 Aug 2016 16:40:33 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 854772EA43; Thu, 4 Aug 2016 16:40:32 -0400 (EDT) From: Andy Wingo To: "Glenn Michaels" Subject: Re: bug#24080: fold-left description in (rnrs lists) section of guile manual incorrect References: Date: Thu, 04 Aug 2016 22:40:25 +0200 In-Reply-To: (Glenn Michaels's message of "Tue, 26 Jul 2016 16:15:06 -0400") Message-ID: <8760rgtghy.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: B052CA1C-5A83-11E6-9BC3-C1836462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 24080-done Cc: 24080-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: -1.2 (-) On Tue 26 Jul 2016 22:15, "Glenn Michaels" writes: > The section on the (rnrs lists) library in the guile manual contains the = following: > > Scheme Procedure: fold-left combine nil list1 list2 =E2=80=A6 > Scheme Procedure: fold-right combine nil list1 list2 =E2=80=A6 > > These procedures are identical to the fold and fold-right procedures = provided by SRFI-1. I believe this was fixed by commit 498cd58cb43e0dde024ad3c62983def16a0c7ca9 Author: Andy Wingo Date: Thu Jun 23 21:39:23 2016 +0200 Fix R6RS fold-left documentation =20=20=20=20=20=20 * doc/ref/r6rs.texi (rnrs lists): Fix documentation of fold-left. Should be out in 2.1.4. Cheers, Andy From unknown Sun Sep 07 01:26:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 02 Sep 2016 11:24:05 +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