From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#34781: 27.0.50; integer in pcase sometimes compared by eq Date: Thu, 28 Mar 2019 15:10:14 -0700 Organization: UCLA Computer Science Department Message-ID: References: <95f744d5-426d-1ce1-15fa-9c49aaf6f2f0@cs.ucla.edu> <3a02a3378a526c8706b33f36b85c003a82aa2aa1.camel@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="1687"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 Cc: monnier@iro.umontreal.ca, 34781@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 28 23:22:41 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9dQ0-0000GL-Ch for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Mar 2019 23:22:40 +0100 Original-Received: from localhost ([127.0.0.1]:42667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9dPz-00031e-CA for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Mar 2019 18:22:39 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9dPH-0002Xs-GL for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2019 18:21:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9dEl-0008Vo-1J for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2019 18:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49543) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h9dEk-0008Ve-PU for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2019 18:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h9dEk-0000B3-Hk for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2019 18:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Mar 2019 22:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34781 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34781-submit@debbugs.gnu.org id=B34781.1553811025630 (code B ref 34781); Thu, 28 Mar 2019 22:11:02 +0000 Original-Received: (at 34781) by debbugs.gnu.org; 28 Mar 2019 22:10:25 +0000 Original-Received: from localhost ([127.0.0.1]:34854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h9dE8-0000A5-MB for submit@debbugs.gnu.org; Thu, 28 Mar 2019 18:10:24 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h9dE6-00009n-2t for 34781@debbugs.gnu.org; Thu, 28 Mar 2019 18:10:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A2D54160F0B; Thu, 28 Mar 2019 15:10:15 -0700 (PDT) Original-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 WjOhO8ImRPmA; Thu, 28 Mar 2019 15:10:14 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BF9F8160F16; Thu, 28 Mar 2019 15:10:14 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-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 uNxp8QJUnlA9; Thu, 28 Mar 2019 15:10:14 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9F847160EEC; Thu, 28 Mar 2019 15:10:14 -0700 (PDT) Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+ KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBfgQTAQIAKAUCTIByZAIbAwUJEswDAAYLCQgHAwIG FQgCCQoLBBYCAwECH In-Reply-To: <3a02a3378a526c8706b33f36b85c003a82aa2aa1.camel@acm.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156906 Archived-At: > > +Since the size of fixnums varies between platforms, the new predicate > +'portable-fixnum-p' can be used to determine whether a number is > +a fixnum on any machine running the current Emacs version. The news item should also mention most-negative-portable-fixnum etc. Try to be terser; e.g., "can be used to determine" -> "determines". > > +(defun portable-fixnum-p (object) > +=C2=A0 "Return t if OBJECT is a fixnum on any machine running the curr= ent > +Emacs version." The usage message can fit on one line. > +=C2=A0 (and (integerp object) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (<=3D most-negative-portable-fixn= um object > most-positive-portable-fixnum))) integerp -> fixnump > +=C2=A0 DEFVAR_LISP ("most-positive-portable-fixnum", > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 Vmost_positive_portable_fixnum, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 doc: /* The greatest integer that is represented > efficiently > +on any machine running this version of Emacs. Try to have the first line explain things tersely. Something like "The largest integer representable as a fixnum on any platform." More details can be in later lines, if needed. > +=C2=A0 Vmost_positive_portable_fixnum =3D > make_fixnum(MOST_POSITIVE_PORTABLE_FIXNUM); Space before parenthesis (elsewhere, too). > > diff --git a/src/lisp.h b/src/lisp.h > index 178eebed2a..bf1f0a0bf5 100644 > --- a/src/lisp.h > +++ b/src/lisp.h These changes should be in data.c not lisp.h, since only data.c needs them and it's not likely any other code will need them. > > +/* The smallest portable value of EMACS_INT_MAX.=C2=A0 */ > +#define LEAST_EMACS_INT_MAX 2147483647=C2=A0=C2=A0 /* 2**31 - 1 */ There's no need to make it a macro. Also, the LEAST_* prefix and *_MAX suffix are confusing: which takes priority? I suggest sticking to suffixes, since that seems to be the convention. Something like =C2=A0 int EMACS_INT_MAX_MIN =3D 2147483647; as a local in the only function that needs it, and similarly for the related macros. Although you can use 'verify' to check that EMACS_INT_MAX_MIN <=3D EMACS_INT_MAX, I'm not sure I'd bother as we're going to add overflow checking to make_fixnum at some point anyway. This stuff should be documented in the manual, too, next to the documentation of most-positive-fixnum and fixnump respectively. Thanks again for taking this on.