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: Mon, 10 Feb 2020 15:55:03 -0800 (PST) Message-ID: <3d420026-bb32-413f-9a9c-304240aa82e2@default> 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="87776"; mail-complaints-to="usenet@ciao.gmane.io" To: 39557@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 11 00:56:12 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 1j1IuR-000Mk3-UB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Feb 2020 00:56:12 +0100 Original-Received: from localhost ([::1]:41148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1IuQ-0007CG-KX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Feb 2020 18:56:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52457) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1IuJ-0007C9-9Z for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 18:56:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1IuI-0000ag-3t for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 18:56:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1IuH-0000Zk-V7 for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 18:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1IuH-0001fT-Rd for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 18:56: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: Mon, 10 Feb 2020 23:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39557 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15813789146352 (code B ref -1); Mon, 10 Feb 2020 23:56:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Feb 2020 23:55:14 +0000 Original-Received: from localhost ([127.0.0.1]:55708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1ItV-0001eO-Ke for submit@debbugs.gnu.org; Mon, 10 Feb 2020 18:55:13 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:50255) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1ItT-0001eF-1v for submit@debbugs.gnu.org; Mon, 10 Feb 2020 18:55:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50804) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1ItR-00073u-Li for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 18:55:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1ItP-0006Dg-32 for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 18:55:08 -0500 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:46588) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1ItO-00065j-RU for bug-gnu-emacs@gnu.org; Mon, 10 Feb 2020 18:55:07 -0500 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01ANmeRh095726 for ; Mon, 10 Feb 2020 23:55:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=c0Cx9t5LqBFI/bnZrERezYT6fNx7rujqXgLvu6N3O6I=; b=C4XU8/rv0G6v5/EOK62iyarkyXuoIZBWvpSUGs1hL2ynXTJkfyd87PzBWKZ9UsEyXejz hHg1pxaDnMDvNLteKuKNdpjbFuAJBU9eYEHxK/5GpRMfo4tseHlLkXQfAYp5c1HMGGzP 7x86EmGEFbKE0HuLxxYQG8gKUdw5m+mmbgeJ3netvGcM/DblezwEbp5cPPf+tvcQfGuf A9V1pcH2NdCkQ2tThMyoc943Lf2qfKri8HlM26ah+3/I6WeqKirsuHIKrvPDRhxussaC alAVlpi9MMZ02MkQDvUVWXYnJVZgCEIieUlG8lqT+QzH7iGLNGUR3CHsSnwLwJPQSj7C 3A== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2y2jx60awv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 10 Feb 2020 23:55:04 +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 01ANm7Qt140917 for ; Mon, 10 Feb 2020 23:55:04 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2y26htw7rk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 10 Feb 2020 23:55:04 +0000 Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 01ANt3Tx024883 for ; Mon, 10 Feb 2020 23:55:03 GMT 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=9527 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=891 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 suspectscore=1 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002100169 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9527 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=956 malwarescore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=1 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002100169 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] 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:175916 Archived-At: The Elisp manual's presentation of fixnums and bignums could be improved. It should say something similar to what the Common Lisp manual says: Common Lisp is designed to hide this distinction as much as possible; the distinction between fixnums and bignums is visible to the user in only a few places where the efficiency of representation is important. Exactly which integers are fixnums is implementation-dependent; typically they will be those integers in the range -2**n to 2**(n-1), inclusive, for some n not less than 15. See most-positive-fixnum and most-negative-fixnum. IOW, don't worry about whether an integer is a fixnum or a bignum, in general. Instead, right off the bat the Elisp doc tells users: Some functions in Emacs accept only fixnums. Also, while fixnums can always be compared for numeric equality with 'eq', bignums require more-heavyweight equality predicates like 'eql'." That's really the _last_ thing we should tell users, not the first. And even if we tell them something like that we should NOT emphasize using `eq' ("bignums _require_..."). We should NOT give users the impression that they should want to avoid the "more-heavyweight" comparison function `eql'. We should instead tell users, right away, that they can (and typically should) use `eql' for comparing any integers, regardless of whether they happen, on this or that platform/machine, to be fixnums or bignums. I'm really surprised this doc got inserted as it is. Using `eq' is only an optimisation; it's platform/machine-specific; and it makes users worry about whether the numbers being compared are both fixnums. (Sure, they can always test first with `fixnump' or `bignump', but still...) And I don't see where the doc tells you how the Lisp reader treats an integer numeral - when it gives you a fixnum and when it gives you a bignum. Shouldn't it tell you that you get a fixnum whenever the value is within the fixnum range (if that's in fact the case)? I mean, if you're going to be comparing against a literal value, and the doc slants you toward using `eq' as it does, you'll at least want to know whether some numeral ends up as a fixnum or a bignum. (Sure, you can always test it...) (BTW, this doc should probably also mention that the numerical value of a marker is an integer. Sure, if they follow the link to node Markers they'll find that out, but still.) In GNU Emacs 27.0.60 (build 1, x86_64-w64-mingw32) of 2019-12-28 Repository revision: 21c3020fcec0a32122d2680a391864a75393031b Windowing system distributor `Microsoft Corp.', version 10.0.18362 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install -C 'CFLAGS=3D-O2 -static -g3''