From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#39557: 27.0.60; Elisp manual, doc about bignums Date: Tue, 11 Feb 2020 14:34:22 -0800 (PST) Message-ID: <7f19329d-6d7e-40e1-9c5c-ef6b58e25a62@default> References: <3d420026-bb32-413f-9a9c-304240aa82e2@default> <8336bhrrb4.fsf@gnu.org> <85sgjgyeya.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="18222"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39557@debbugs.gnu.org To: Noam Postavsky , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 11 23:35:32 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j1e7w-0004aM-0w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Feb 2020 23:35:32 +0100 Original-Received: from localhost ([::1]:57976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1e7v-00061o-3f for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Feb 2020 17:35:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42617) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1e7T-0005ds-AT for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 17:35:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1e7S-0000X7-1A for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 17:35:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1e7R-0000Wy-Tu for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 17:35:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1e7R-0002Mh-Ou for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 17:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Feb 2020 22:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39557 X-GNU-PR-Package: emacs Original-Received: via spool by 39557-submit@debbugs.gnu.org id=B39557.15814604749047 (code B ref 39557); Tue, 11 Feb 2020 22:35:01 +0000 Original-Received: (at 39557) by debbugs.gnu.org; 11 Feb 2020 22:34:34 +0000 Original-Received: from localhost ([127.0.0.1]:57686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1e6z-0002Lr-T9 for submit@debbugs.gnu.org; Tue, 11 Feb 2020 17:34:34 -0500 Original-Received: from userp2120.oracle.com ([156.151.31.85]:32804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1e6y-0002La-D3 for 39557@debbugs.gnu.org; Tue, 11 Feb 2020 17:34:32 -0500 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01BMV89n147094; Tue, 11 Feb 2020 22:34:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=5jk8cWKQDs4dnfHcvMKrSq4LfSASYcgiZoopYBcpNOk=; b=EBmJ4w1pWo+RqNDDWVG+7CVV/Y1cfDiqlV9gGDbq1adrdB6tjBbv2kJoAtGYeSxWmCoY PEiKR2v+DOeioA7O8n1vANPLPmmvA03gExzvOyw4yu2wXvkHPePOwStasMwqxuAqnXny T7kiTx0aK3RNCJglw0fhuN/0V33jNY8yT71r0O14se+a9wVZD1iHKkgsjxjk8zC6lEXy cIUpmP5yDmZrNRUjrnonWjIEE12CW1W4AaGlqQ4wy+vcDZxD0ipLP8o79o4m2b3ci85X JyHEmPdqdAK3hMU0YSDnu6k3Q0Y5dKN4ehHIopx/Szl7bSEMzKmezYTEdqWFkcc0X9DI IQ== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2y2p3seftx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Feb 2020 22:34:26 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01BMSAHV045951; Tue, 11 Feb 2020 22:34:25 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2y26hvqw57-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Feb 2020 22:34:25 +0000 Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 01BMYMbB030709; Tue, 11 Feb 2020 22:34:24 GMT In-Reply-To: <85sgjgyeya.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4954.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9528 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002110147 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9528 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002110147 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175959 Archived-At: > > There seems to be a contradiction here: where we do describe the > > difference between fixnums and bignums, you argue that we shouldn't, > > but then you pick up a place where we don't distinguish between them, > > and you argue that we should... >=20 > I think Drew intended the argument that we should distinguish them as a > sarcastic reductio ad absurdum. Not at all. I wonder why you would think that, especially when I reiterated: I didn't say we should not describe the difference between the two. Not at all. It's appropriate to distinguish them in the doc, since they are distinguished in reality. They have different behavior. I argued for treatment similar to what the Common Lisp doc provides. (And I pointed to that doc. You might want to take a look.) The Common Lisp doc guides you to, a priori, treating them the same in your code that uses them. That is, as a general rule, ignore their difference as much as possible -- think integer. And that means think (use) `eql'. If and when you really need to distinguish them in practice (rare), then do so. And of course the doc should tell you how to do that. I object to the doc about integers starting off by telling you "bignums require more-heavyweight predicates like `eql'", and possibly giving the mistaken impression that you should in general try to use fixnums and `eq'. That's the wrong message to send, IMO, whether explicit or not. The main message of the doc about integers and comparison is that you should, in general, use `eql' - not `eq'. That message isn't delivered, and if you think it is then I'll just suggest that it's lost. I didn't say that we shouldn't mention that fixnums can be compared using `eq'. I said that's the _last_, not the first, thing we should tell them about fixnums and bignums. The fact that fixnums can be compared using `eq' is _not_ a wonderful feature. It can even represent a liability - a risk that users might compare integers generally using `eq'. The use case for comparing integers with `eq' is a corner case. But this doc puts it front and center, as if it were important, or a cool trick that real lispers use: use fixnums as integers because you can use `eq', which isn't so "heavyweight". The message should be to compare integers with `eql' - do NOT use `eq'. --- We can (but we really need not) add that if, for some reason, you know that both numbers are fixnums, then you can use `eq'. But don't start with that. I wouldn't suggest that we even add here that using `eq' is more performant than `eql'. Users who know more generally that `eq' is faster than `eql' will know whether it makes sense for them to use `eq' in any given case when both integers are known to be fixnums.