From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30408: Checking for loss of information on integer conversion Date: Thu, 29 Mar 2018 14:11:10 +0300 Message-ID: <83605fdtm9.fsf@gnu.org> References: <7432641a-cedc-942c-d75c-0320fce5ba39@cs.ucla.edu> <83y3jq9q4m.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1522322036 23429 195.159.176.226 (29 Mar 2018 11:13:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Mar 2018 11:13:56 +0000 (UTC) Cc: 30408@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 29 13:13:52 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1VV9-0005yQ-LX for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2018 13:13:51 +0200 Original-Received: from localhost ([::1]:41891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1VXC-0006xb-47 for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2018 07:15:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1VTT-0003cq-05 for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2018 07:12:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1VTO-0004F7-0G for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2018 07:12:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f1VTN-0004F0-Sz for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2018 07:12:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f1VTN-0004wb-OC for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2018 07:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Mar 2018 11:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30408 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30408-submit@debbugs.gnu.org id=B30408.152232189818974 (code B ref 30408); Thu, 29 Mar 2018 11:12:01 +0000 Original-Received: (at 30408) by debbugs.gnu.org; 29 Mar 2018 11:11:38 +0000 Original-Received: from localhost ([127.0.0.1]:58015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1VT0-0004vy-Hr for submit@debbugs.gnu.org; Thu, 29 Mar 2018 07:11:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1VSy-0004vl-Qn for 30408@debbugs.gnu.org; Thu, 29 Mar 2018 07:11:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1VSo-000492-Nq for 30408@debbugs.gnu.org; Thu, 29 Mar 2018 07:11:31 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1VSo-00048w-KT; Thu, 29 Mar 2018 07:11:26 -0400 Original-Received: from [176.228.60.248] (port=2102 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f1VSn-0007jN-Fi; Thu, 29 Mar 2018 07:11:26 -0400 In-reply-to: (message from Paul Eggert on Tue, 27 Mar 2018 16:19:21 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:144683 Archived-At: > From: Paul Eggert > Date: Tue, 27 Mar 2018 16:19:21 -0700 > > Here's a patch that I hope addresses the main problem. The basic idea is > to avoid the confusion exemplified in Bug#30408 by changing Emacs so > that it ordinarily signals an error if it reads a program that contains > an integer literal that is out of fixnum range. However, if the > out-of-range literal is followed by '.' then Emacs continues to silently > convert it to floating-point; this is intended as an escape hatch for > any programs that need the old behavior (I expect this'll be rare). I'd suggest, for a good measure, to have a variable which would force the conversion to floats, avoiding an error even without the trailing period. We can later remove that variable, or make it a no-op, if the danger of breaking existing code turns out low or non-existent.