GNU bug report logs - #32252
[PATCH] %o and %x now format signed numbers

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 23 Jul 2018 19:14:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 32252 <at> debbugs.gnu.org
Subject: bug#32252: [PATCH] %o and %x now format signed numbers
Date: Thu, 26 Jul 2018 02:15:52 -0700
Helmut Eller wrote:
>> And prohibit %x on bignums? That would make little sense.
> It would prohibit only negative bignums just like negative flonums are
> forbidden.

So under this proposal %x would generate ambiguous output once we add bignums? 
For example, on a 32-bit platform (format "%x" -1) would generate the same 
output as (format "%x" #x3fffffff), even though -1 and #x3fffffff would be 
different integers? That doesn't sound like a good idea.

> it would make much more sense to print flonums the way %a does in C

It would make sense to add an %a specification, like C's %a. But C's %a formats 
floating-point numbers, and surely Emacs Lisp's %a should be similar. That is, 
%a should treat integers the way the other floating-point specs do (%e, %f, %g).

>> Common Lisp and Scheme don't have any such prohibition; why should
>> Emacs Lisp?
> 
> Because Emacs Lisp was very successful without bignums.

This appears to be more an argument against bignums than anything else. I've 
used Emacs Lisp without bignums for many years, and it's *always* been a 
hindrance. I would much rather have bignums, as they would make a lot of things 
simpler. I agree that Emacs Lisp does not much need complex numbers or ratios.




This bug report was last modified 2 years and 322 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.