From debbugs-submit-bounces@debbugs.gnu.org Thu May 23 12:01:23 2019 Received: (at submit) by debbugs.gnu.org; 23 May 2019 16:01:23 +0000 Received: from localhost ([127.0.0.1]:45091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTq9j-0007iJ-5K for submit@debbugs.gnu.org; Thu, 23 May 2019 12:01:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTq9f-0007i3-SA for submit@debbugs.gnu.org; Thu, 23 May 2019 12:01:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:54589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTq9a-0001bF-M9 for submit@debbugs.gnu.org; Thu, 23 May 2019 12:01:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTq9X-0003t4-36 for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 12:01:14 -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.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTq9W-0001YK-5X for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 12:01:11 -0400 Received: from mail80c50.megamailservers.eu ([91.136.10.90]:41832 helo=mail70c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTq9V-0001Wq-C6 for bug-gnu-emacs@gnu.org; Thu, 23 May 2019 12:01:10 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1558627267; bh=Ci1k+iyY/SzH7EAyCu5eZz9Z/8aWlwLG/OFFJO4qnzM=; h=From:Subject:Date:To:From; b=gUyt+8t0Cu1KXGGxFg/k69ApKFBQj5Hl2zhipaPxnRGmm9I3It4Q3ceyETsNC82fv XPZxOnKhwJpiQw0oplufkClpTbzE9UfaEDkWq1Q7oBfwJGg3zqJwnrSAAD+yNTu86f SOg0PHEokoMh3D2jcmSAfsD5xYFqec93lEVKTp3Y= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] ([188.150.171.71]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x4NG15Zr006875 for ; Thu, 23 May 2019 16:01:07 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_22773808-41CA-49E0-A2BF-C47642F79FDF" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [PATCH] `cl-member' and `cl-assoc' do not work for bignums Message-Id: <9DDA083E-C47B-42F4-96A8-BDF8FB08E5EC@acm.org> Date: Thu, 23 May 2019 18:01:05 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B020A.5CE6C3C3.001F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=epTxMLhX c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=Ctdqq3ap4IKs8NbUZ34A:9 a=CjuIK1q_8ugA:10 a=5zPVfcQKmIbxVPxZhCEA:9 a=B2y7HmGcmWMA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.90 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) 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: -2.3 (--) --Apple-Mail=_22773808-41CA-49E0-A2BF-C47642F79FDF Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii (cl-member (ash 1 100) (list (ash 1 100))) => nil (cl-assoc (ash 1 100) (list (cons (ash 1 100) t))) => nil Suggested patch attached. --Apple-Mail=_22773808-41CA-49E0-A2BF-C47642F79FDF Content-Disposition: attachment; filename=0001-Fix-cl-member-and-cl-assoc-for-bignums.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Fix-cl-member-and-cl-assoc-for-bignums.patch" Content-Transfer-Encoding: quoted-printable =46rom=206313fdb00b13246305be0218452afefe9e05432c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=2023=20May=202019=2017:54:58=20+0200=0A= Subject:=20[PATCH]=20Fix=20`cl-member'=20and=20`cl-assoc'=20for=20= bignums=0A=0A*=20lisp/emacs-lisp/cl-seq.el=20(cl-member,=20cl-assoc):=20= Work=20with=20bignums.=0A*=20test/lisp/emacs-lisp/cl-seq-tests.el=20= (cl-seq-bignum-eql):=20New.=0A---=0A=20lisp/emacs-lisp/cl-seq.el=20=20=20= =20=20=20=20=20=20=20=20=20|=206=20++----=0A=20= test/lisp/emacs-lisp/cl-seq-tests.el=20|=208=20++++++++=0A=202=20files=20= changed,=2010=20insertions(+),=204=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/emacs-lisp/cl-seq.el=20b/lisp/emacs-lisp/cl-seq.el=0Aindex=20= 3eb6ea16da..86a73e1997=20100644=0A---=20a/lisp/emacs-lisp/cl-seq.el=0A= +++=20b/lisp/emacs-lisp/cl-seq.el=0A@@=20-703,9=20+703,7=20@@=20= cl-member=0A=20=09(while=20(and=20cl-list=20(not=20(cl--check-test=20= cl-item=20(car=20cl-list))))=0A=20=09=20=20(setq=20cl-list=20(cdr=20= cl-list)))=0A=20=09cl-list)=0A-=20=20=20=20(if=20(and=20(numberp=20= cl-item)=20(not=20(integerp=20cl-item)))=0A-=09(member=20cl-item=20= cl-list)=0A-=20=20=20=20=20=20(memq=20cl-item=20cl-list))))=0A+=20=20=20=20= (memql=20cl-item=20cl-list)))=0A=20(autoload=20= 'cl--compiler-macro-member=20"cl-macs")=0A=20=0A=20;;;###autoload=0A@@=20= -744,7=20+742,7=20@@=20cl-assoc=0A=20=09=09=09(not=20(cl--check-test=20= cl-item=20(car=20(car=20cl-alist))))))=0A=20=09=20=20(setq=20cl-alist=20= (cdr=20cl-alist)))=0A=20=09(and=20cl-alist=20(car=20cl-alist)))=0A-=20=20= =20=20(if=20(and=20(numberp=20cl-item)=20(not=20(integerp=20cl-item)))=0A= +=20=20=20=20(if=20(numberp=20cl-item)=0A=20=09(assoc=20cl-item=20= cl-alist)=0A=20=20=20=20=20=20=20(assq=20cl-item=20cl-alist))))=0A=20= (autoload=20'cl--compiler-macro-assoc=20"cl-macs")=0Adiff=20--git=20= a/test/lisp/emacs-lisp/cl-seq-tests.el=20= b/test/lisp/emacs-lisp/cl-seq-tests.el=0Aindex=2086288e99ca..6515eee9f2=20= 100644=0A---=20a/test/lisp/emacs-lisp/cl-seq-tests.el=0A+++=20= b/test/lisp/emacs-lisp/cl-seq-tests.el=0A@@=20-302,6=20+302,14=20@@=20= cl-seq--with-side-effects=0A=20=20=20=20=20(should=20(equal=20'(2=208)=20= (last=20(cl-replace=20list=20list2)=202)))=0A=20=20=20=20=20(should=20= (equal=20'(1=201)=20(last=20(cl-fill=20list=201)=202)))))=0A=20=0A= +(ert-deftest=20cl-seq-bignum-eql=20()=0A+=20=20(let=20((x=20(+=20= most-positive-fixnum=201))=0A+=20=20=20=20=20=20=20=20(y=20(+=20= most-positive-fixnum=201)))=0A+=20=20=20=20(let=20((l=20(list=20y)))=0A+=20= =20=20=20=20=20(should=20(eq=20(cl-member=20x=20l)=20l)))=0A+=20=20=20=20= (let=20((a=20(list=20(cons=20y=201)=20(cons=202=20y))))=0A+=20=20=20=20=20= =20(should=20(eq=20(cl-assoc=20x=20a)=20(car=20a)))=0A+=20=20=20=20=20=20= (should=20(eq=20(cl-rassoc=20x=20a)=20(cadr=20a))))))=0A=20=0A=20= (provide=20'cl-seq-tests)=0A=20;;;=20cl-seq-tests.el=20ends=20here=0A--=20= =0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_22773808-41CA-49E0-A2BF-C47642F79FDF-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 01 21:15:56 2019 Received: (at 35869-done) by debbugs.gnu.org; 2 Jun 2019 01:15:56 +0000 Received: from localhost ([127.0.0.1]:39096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXF6K-0001ZC-3d for submit@debbugs.gnu.org; Sat, 01 Jun 2019 21:15:56 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXF6H-0001Yu-TT for 35869-done@debbugs.gnu.org; Sat, 01 Jun 2019 21:15:54 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 82C2A160986; Sat, 1 Jun 2019 18:15:47 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id YnbKSrmG9rTi; Sat, 1 Jun 2019 18:15:46 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id ACAAD160989; Sat, 1 Jun 2019 18:15:46 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id olV4ElXIvi9T; Sat, 1 Jun 2019 18:15:46 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 828B4160957; Sat, 1 Jun 2019 18:15:46 -0700 (PDT) To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= From: Paul Eggert Subject: Re: [PATCH] `cl-member' and `cl-assoc' do not work for bignums Organization: UCLA Computer Science Department Message-ID: <690e4e34-4c58-4452-9d9e-765fc2f90677@cs.ucla.edu> Date: Sat, 1 Jun 2019 18:15:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------DDA4B7A3CD9E12CA0A1AA0CA" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35869-done Cc: 35869-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: -3.3 (---) This is a multi-part message in MIME format. --------------DDA4B7A3CD9E12CA0A1AA0CA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks, I installed that into the master branch, along with the attached minor tuneup to restore some of the optimization that was in the original code. --------------DDA4B7A3CD9E12CA0A1AA0CA Content-Type: text/x-patch; name="0001-Tune-cl-assoc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Tune-cl-assoc.patch" >From 1fd7d5086205852f1433e5042ca4efc1d50b1996 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 1 Jun 2019 18:12:31 -0700 Subject: [PATCH] Tune cl-assoc * lisp/emacs-lisp/cl-seq.el (cl-assoc): Use assq for fixnums. --- lisp/emacs-lisp/cl-seq.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index 86a73e1997..87c02a6b54 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -742,7 +742,7 @@ cl-assoc (not (cl--check-test cl-item (car (car cl-alist)))))) (setq cl-alist (cdr cl-alist))) (and cl-alist (car cl-alist))) - (if (numberp cl-item) + (if (and (numberp cl-item) (not (fixnump cl-item))) (assoc cl-item cl-alist) (assq cl-item cl-alist)))) (autoload 'cl--compiler-macro-assoc "cl-macs") -- 2.17.1 --------------DDA4B7A3CD9E12CA0A1AA0CA-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 02 09:05:57 2019 Received: (at 35869-done) by debbugs.gnu.org; 2 Jun 2019 13:05:57 +0000 Received: from localhost ([127.0.0.1]:39686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXQBQ-0006wB-T3 for submit@debbugs.gnu.org; Sun, 02 Jun 2019 09:05:57 -0400 Received: from mail78c50.megamailservers.eu ([91.136.10.88]:45388 helo=mail70c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXQBO-0006vv-DH for 35869-done@debbugs.gnu.org; Sun, 02 Jun 2019 09:05:55 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1559480741; bh=2CLbGbxqi+oGiDoy3/uO/doU5ckmOPi/L02Y3HcRlNM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=ZBAywMyN7H7ezcL4cOLcm+wgvUYYP36MZKKIp4+8EpiLFe2PVjgbBRdJPwp6qybzF KnY0H8eWt3NsERI/TErmuPIc8VdJxDiZuTEvgVdQVUGt4SFGAwyFEMFqhao/9/Lsxi VqSLD67ey8POvSUua+d8yXH6Tl8SwgPT0rewuQAM= Feedback-ID: mattiase@acm.or Received: from [192.168.1.65] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x52D5dR5017697; Sun, 2 Jun 2019 13:05:41 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH] `cl-member' and `cl-assoc' do not work for bignums From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <690e4e34-4c58-4452-9d9e-765fc2f90677@cs.ucla.edu> Date: Sun, 2 Jun 2019 15:05:39 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4D8A138A-EB57-4538-ADF2-95FBBABC0CA3@acm.org> References: <690e4e34-4c58-4452-9d9e-765fc2f90677@cs.ucla.edu> To: Paul Eggert X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0208.5CF3C9A5.0037, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=epTxMLhX c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=PwMPzSKmwPG2H9cubeYA:9 a=CjuIK1q_8ugA:10 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 35869-done Cc: 35869-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.7 (/) 2 juni 2019 kl. 03.15 skrev Paul Eggert : >=20 > Thanks, I installed that into the master branch, along with the = attached minor tuneup to restore some of the optimization that was in = the original code. A good improvement, and thank you! From unknown Tue Jun 17 01:39:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 01 Jul 2019 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