From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: integer overflow handling for most-negative-fixnum Date: Sat, 21 Jul 2018 22:10:39 +0200 Message-ID: References: <867elsq78b.fsf@gmail.com> <866018yl76.fsf@gmail.com> <83a7qkzyhz.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1532203742 6192 195.159.176.226 (21 Jul 2018 20:09:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 20:09:02 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 21 22:08:58 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fgyBU-0001Tq-Ny for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 22:08:56 +0200 Original-Received: from localhost ([::1]:53846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgyDb-00036f-L0 for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 16:11:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgyDS-00036a-A1 for emacs-devel@gnu.org; Sat, 21 Jul 2018 16:10:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgyDP-0004Sy-4s for emacs-devel@gnu.org; Sat, 21 Jul 2018 16:10:58 -0400 Original-Received: from [195.159.176.226] (port=33493 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgyDO-0004Sh-TJ for emacs-devel@gnu.org; Sat, 21 Jul 2018 16:10:55 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fgyBD-00016n-ML for emacs-devel@gnu.org; Sat, 21 Jul 2018 22:08:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:jEBeoHeSkgz2jNSVdMtZx7xHqXI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227641 Archived-At: On Sat, Jul 21 2018, Paul Eggert wrote: > How about this idea. First, we extend 'format' to support bitwidth > modifiers for twos-complement representation. For example, (format > "%/24x" -1) would format just the low-order 24 bits of the integer, > and would return "ffffff" regardless of machine word size or whether > bignums are used. That sounds reasonable. > Second, we change (format "%x" -1) to return "-1" rather than a > machine-dependent string like "3fffffffffffffff" as it does now. That > would make Elisp be more machine-independent, would solve Andy's > problem, and would solve other problems once we have bignums, and in > hindsight it's what we should have done originally. Can't you simply use some other character for this, like %z (or %ℤ) and leave %x alone. BTW, %i also seems to be a valid format specifier but where is it documented? > However, it would > be an incompatible change, so let's have the behavior depend on a > compatibility variable, much as we already do for > read-integer-overflow-as-float. This sounds more like that other desaster: text-quoting-style. Helmut