From unknown Tue Aug 19 23:15:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22630: [PATCH] Let assv/assoc shortcircuit to assq where feasible Resent-From: David Kastrup Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 11 Feb 2016 11:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22630 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: 22630@debbugs.gnu.org Cc: David Kastrup X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14551903338366 (code B ref -1); Thu, 11 Feb 2016 11:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Feb 2016 11:32:13 +0000 Received: from localhost ([127.0.0.1]:35717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTpTp-0002As-JY for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:32:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56041) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTpTn-0002AG-Ut for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:32:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTpTb-0002w7-Ry for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:32:00 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTpTb-0002w3-PL for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:31:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTpTa-0007Kw-N7 for bug-guile@gnu.org; Thu, 11 Feb 2016 06:31:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTpTZ-0002vW-LG for bug-guile@gnu.org; Thu, 11 Feb 2016 06:31:58 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTpTZ-0002vL-Hd for bug-guile@gnu.org; Thu, 11 Feb 2016 06:31:57 -0500 Received: from localhost ([127.0.0.1]:49918 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1aTpTW-0001Kj-SV; Thu, 11 Feb 2016 06:31:55 -0500 Received: by lola (Postfix, from userid 1000) id 3CE49DF5B8; Thu, 11 Feb 2016 12:31:54 +0100 (CET) From: David Kastrup Date: Thu, 11 Feb 2016 12:31:48 +0100 Message-Id: <1455190308-16788-1-git-send-email-dak@gnu.org> X-Mailer: git-send-email 2.5.0 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.3 (-----) 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.3 (-----) * libguile/alist.c (scm_sloppy_assv, scm_sloppy_assoc): Shortcircuit to scm_sloppy_assq where feasible (scm_assv, scm_assoc): Shortcircuit to scm_assq where feasible --- libguile/alist.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libguile/alist.c b/libguile/alist.c index f33aa41..e9bb80e 100644 --- a/libguile/alist.c +++ b/libguile/alist.c @@ -28,6 +28,7 @@ #include "libguile/validate.h" #include "libguile/pairs.h" +#include "libguile/numbers.h" #include "libguile/alist.h" @@ -72,6 +73,12 @@ SCM_DEFINE (scm_sloppy_assv, "sloppy-assv", 2, 0, 0, "Recommended only for use in Guile internals.") #define FUNC_NAME s_scm_sloppy_assv { + /* Non-immediate numbers are the only keys we need to check + * other than with eq + */ + if (!SCM_NUMP (key)) + return scm_sloppy_assq (key, alist); + for (; scm_is_pair (alist); alist = SCM_CDR (alist)) { SCM tmp = SCM_CAR (alist); @@ -90,6 +97,10 @@ SCM_DEFINE (scm_sloppy_assoc, "sloppy-assoc", 2, 0, 0, "Recommended only for use in Guile internals.") #define FUNC_NAME s_scm_sloppy_assoc { + /* Immediate values can be checked using eq */ + if (SCM_IMP (key)) + return scm_sloppy_assq (key, alist); + for (; scm_is_pair (alist); alist = SCM_CDR (alist)) { SCM tmp = SCM_CAR (alist); @@ -139,6 +150,13 @@ SCM_DEFINE (scm_assv, "assv", 2, 0, 0, #define FUNC_NAME s_scm_assv { SCM ls = alist; + + /* Non-immediate numbers are the only keys we need to check + * other than with eq + */ + if (!SCM_NUMP (key)) + return scm_assq (key, alist); + for(; scm_is_pair (ls); ls = SCM_CDR (ls)) { SCM tmp = SCM_CAR (ls); @@ -160,6 +178,11 @@ SCM_DEFINE (scm_assoc, "assoc", 2, 0, 0, #define FUNC_NAME s_scm_assoc { SCM ls = alist; + + /* Immediate values can be checked using eq */ + if (SCM_IMP (key)) + return scm_assq (key, alist); + for(; scm_is_pair (ls); ls = SCM_CDR (ls)) { SCM tmp = SCM_CAR (ls); -- 2.5.0 From unknown Tue Aug 19 23:15:46 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: David Kastrup Subject: bug#22630: closed (Re: bug#22630: [PATCH] Let assv/assoc shortcircuit to assq where feasible) Message-ID: References: <8760rcpaga.fsf@pobox.com> <1455190308-16788-1-git-send-email-dak@gnu.org> X-Gnu-PR-Message: they-closed 22630 X-Gnu-PR-Package: guile X-Gnu-PR-Keywords: patch Reply-To: 22630@debbugs.gnu.org Date: Sun, 07 Aug 2016 20:54:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1470603242-5527-1" This is a multi-part message in MIME format... ------------=_1470603242-5527-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #22630: [PATCH] Let assv/assoc shortcircuit to assq where feasible which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 22630@debbugs.gnu.org. --=20 22630: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D22630 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1470603242-5527-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 22630-done) by debbugs.gnu.org; 7 Aug 2016 20:53:54 +0000 Received: from localhost ([127.0.0.1]:59249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWV50-0001Ql-Iy for submit@debbugs.gnu.org; Sun, 07 Aug 2016 16:53:54 -0400 Received: from pb-sasl2.pobox.com ([64.147.108.67]:63428 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWV4y-0001Qa-Q2 for 22630-done@debbugs.gnu.org; Sun, 07 Aug 2016 16:53:53 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id DB55030740; Sun, 7 Aug 2016 16:53:49 -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; s=sasl; bh=SJ+gqoDC5afsY7Zmz/BJmKu3v8o=; b=c7sY5u h7CCPrI77ZYpyDn1F9fiNFOdHphNCHbgrGK5JZRjvU2mTEpWgE5V0PVz+wttzQDh zFrXg7xqf0HWGDYLR5LCJfVYDr8q/DWsmInb6ayTzbNWCxhPgTo4UpH+J3Fhosup c/kz6wknsvW8UBVor/hl7+jSnvL0jhT3kF1XE= 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; q=dns; s=sasl; b=oeUgf3R1L26tw0biq1xymYYnuyFeqWx4 WgVyklfzIfeYPABs4PgCTaQjjJrLefqwS8dvGW5lCIJhROB57sp3JR0s596+3ukB hkbjYt0rt+zdIk0IkLuKq6j/FPXJCNJb+IH3NPz4hixgcohFR1aWxNZqZr3IOfBy dfn4fql5mh4= Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id C384C3073E; Sun, 7 Aug 2016 16:53:49 -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-sasl2.pobox.com (Postfix) with ESMTPSA id CE7A03073D; Sun, 7 Aug 2016 16:53:48 -0400 (EDT) From: Andy Wingo To: David Kastrup Subject: Re: bug#22630: [PATCH] Let assv/assoc shortcircuit to assq where feasible References: <1455190308-16788-1-git-send-email-dak@gnu.org> Date: Sun, 07 Aug 2016 22:53:41 +0200 In-Reply-To: <1455190308-16788-1-git-send-email-dak@gnu.org> (David Kastrup's message of "Thu, 11 Feb 2016 12:31:48 +0100") Message-ID: <8760rcpaga.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 0A4160CE-5CE1-11E6-BCD4-28A6F1301B6D-02397024!pb-sasl2.pobox.com X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 22630-done Cc: 22630-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: -0.4 (/) On Thu 11 Feb 2016 12:31, David Kastrup writes: > * libguile/alist.c (scm_sloppy_assv, scm_sloppy_assoc): > Shortcircuit to scm_sloppy_assq where feasible > (scm_assv, scm_assoc): Shortcircuit to scm_assq where feasible Applied to master, will backport when I get a chance. Thanks :) Andy ------------=_1470603242-5527-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 Feb 2016 11:32:13 +0000 Received: from localhost ([127.0.0.1]:35717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTpTp-0002As-JY for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:32:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56041) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTpTn-0002AG-Ut for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:32:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTpTb-0002w7-Ry for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:32:00 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTpTb-0002w3-PL for submit@debbugs.gnu.org; Thu, 11 Feb 2016 06:31:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTpTa-0007Kw-N7 for bug-guile@gnu.org; Thu, 11 Feb 2016 06:31:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTpTZ-0002vW-LG for bug-guile@gnu.org; Thu, 11 Feb 2016 06:31:58 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTpTZ-0002vL-Hd for bug-guile@gnu.org; Thu, 11 Feb 2016 06:31:57 -0500 Received: from localhost ([127.0.0.1]:49918 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1aTpTW-0001Kj-SV; Thu, 11 Feb 2016 06:31:55 -0500 Received: by lola (Postfix, from userid 1000) id 3CE49DF5B8; Thu, 11 Feb 2016 12:31:54 +0100 (CET) From: David Kastrup To: bug-guile@gnu.org Subject: [PATCH] Let assv/assoc shortcircuit to assq where feasible Date: Thu, 11 Feb 2016 12:31:48 +0100 Message-Id: <1455190308-16788-1-git-send-email-dak@gnu.org> X-Mailer: git-send-email 2.5.0 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.3 (-----) X-Debbugs-Envelope-To: submit Cc: David Kastrup 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.3 (-----) * libguile/alist.c (scm_sloppy_assv, scm_sloppy_assoc): Shortcircuit to scm_sloppy_assq where feasible (scm_assv, scm_assoc): Shortcircuit to scm_assq where feasible --- libguile/alist.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/libguile/alist.c b/libguile/alist.c index f33aa41..e9bb80e 100644 --- a/libguile/alist.c +++ b/libguile/alist.c @@ -28,6 +28,7 @@ #include "libguile/validate.h" #include "libguile/pairs.h" +#include "libguile/numbers.h" #include "libguile/alist.h" @@ -72,6 +73,12 @@ SCM_DEFINE (scm_sloppy_assv, "sloppy-assv", 2, 0, 0, "Recommended only for use in Guile internals.") #define FUNC_NAME s_scm_sloppy_assv { + /* Non-immediate numbers are the only keys we need to check + * other than with eq + */ + if (!SCM_NUMP (key)) + return scm_sloppy_assq (key, alist); + for (; scm_is_pair (alist); alist = SCM_CDR (alist)) { SCM tmp = SCM_CAR (alist); @@ -90,6 +97,10 @@ SCM_DEFINE (scm_sloppy_assoc, "sloppy-assoc", 2, 0, 0, "Recommended only for use in Guile internals.") #define FUNC_NAME s_scm_sloppy_assoc { + /* Immediate values can be checked using eq */ + if (SCM_IMP (key)) + return scm_sloppy_assq (key, alist); + for (; scm_is_pair (alist); alist = SCM_CDR (alist)) { SCM tmp = SCM_CAR (alist); @@ -139,6 +150,13 @@ SCM_DEFINE (scm_assv, "assv", 2, 0, 0, #define FUNC_NAME s_scm_assv { SCM ls = alist; + + /* Non-immediate numbers are the only keys we need to check + * other than with eq + */ + if (!SCM_NUMP (key)) + return scm_assq (key, alist); + for(; scm_is_pair (ls); ls = SCM_CDR (ls)) { SCM tmp = SCM_CAR (ls); @@ -160,6 +178,11 @@ SCM_DEFINE (scm_assoc, "assoc", 2, 0, 0, #define FUNC_NAME s_scm_assoc { SCM ls = alist; + + /* Immediate values can be checked using eq */ + if (SCM_IMP (key)) + return scm_assq (key, alist); + for(; scm_is_pair (ls); ls = SCM_CDR (ls)) { SCM tmp = SCM_CAR (ls); -- 2.5.0 ------------=_1470603242-5527-1-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 11 04:50:45 2016 Received: (at control) by debbugs.gnu.org; 11 Oct 2016 08:50:45 +0000 Received: from localhost ([127.0.0.1]:51700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btslp-0006pV-FF for submit@debbugs.gnu.org; Tue, 11 Oct 2016 04:50:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btsln-0006pF-SH for control@debbugs.gnu.org; Tue, 11 Oct 2016 04:50:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btslh-00040l-MG for control@debbugs.gnu.org; Tue, 11 Oct 2016 04:50:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 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]:34111 helo=lola.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btslh-0003zE-Bt for control@debbugs.gnu.org; Tue, 11 Oct 2016 04:50:37 -0400 Received: by lola.localdomain (Postfix, from userid 1000) id 6A204E112C; Tue, 11 Oct 2016 10:50:35 +0200 (CEST) From: David Kastrup To: control@debbugs.gnu.org Subject: see below Date: Tue, 11 Oct 2016 10:50:35 +0200 Message-ID: <87twcj9smc.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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.3 (-----) X-Debbugs-Envelope-To: control 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.3 (-----) unarchive 22630 -- David Kastrup From unknown Tue Aug 19 23:15:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22630: Bad comment References: <1455190308-16788-1-git-send-email-dak@gnu.org> In-Reply-To: <1455190308-16788-1-git-send-email-dak@gnu.org> Resent-From: David Kastrup Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 11 Oct 2016 09:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22630 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: 22630@debbugs.gnu.org Received: via spool by 22630-submit@debbugs.gnu.org id=B22630.14761766012652 (code B ref 22630); Tue, 11 Oct 2016 09:04:02 +0000 Received: (at 22630) by debbugs.gnu.org; 11 Oct 2016 09:03:21 +0000 Received: from localhost ([127.0.0.1]:51712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btsy0-0000gg-Sz for submit@debbugs.gnu.org; Tue, 11 Oct 2016 05:03:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btsxy-0000gU-UZ for 22630@debbugs.gnu.org; Tue, 11 Oct 2016 05:03:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btsxs-0001Tr-VE for 22630@debbugs.gnu.org; Tue, 11 Oct 2016 05:03:13 -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.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34298 helo=lola.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btsxs-0001TJ-Kx for 22630@debbugs.gnu.org; Tue, 11 Oct 2016 05:03:12 -0400 Received: by lola.localdomain (Postfix, from userid 1000) id EE629E112C; Tue, 11 Oct 2016 11:03:11 +0200 (CEST) From: David Kastrup Date: Tue, 11 Oct 2016 11:03:11 +0200 Message-ID: <87pon79s1c.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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.3 (-----) 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.3 (-----) I routinely rebase before abandoning my patches so it only now caught my attention that this bug fix was committed with changed comments. Unfortunately, one of those comments was changed for the worse. Here is the respective merge conflict: <<<<<<< 4f324684cc7672b39800bce0a373da10057dc3c6 /* In Guile, `assv' is the same as `assq' for keys of all types except numbers. */ ======= /* Non-immediate numbers are the only keys we need to check * other than with eq */ >>>>>>> Let assv/assoc shortcircuit to assq where feasible if (!SCM_NUMP (key)) return scm_sloppy_assq (key, alist); The first of the comments is the one actually in the repository. Apart from the difference in formatting (which is fine) it features a different in content that is extremely misleading. SCM_NUMP indeed checks for _nonimmediate_ numbers (as opposed to the more inclusive SCM_NUMBERP). Since this comment concerns a _very_ deliberate and nontrivial optimization and since the name of the macro SCM_NUMP is fabulously misleading (which apparently triggered the comment change in the first place), I'd consider it important to fix the comment. It might even be an idea to replace the condition with if (SCM_IMP (key) || !SCM_NUMBERP (key)) (which yields an ugly macro expansion but the compiler might optimize it) or if (SCM_IMP (key) || !SCM_NUMP (key)) both of which are sort of nonsensical to the compiler (the latter more so than the former) but might be less confusing to the human reader. Or find a better name for SCM_NUMP in the first place. At any rate, the minimally invasive option would be to restore the original comment albeit with typographic fixes, namely writing `eq?' instead of just eq. -- David Kastrup