|
From: | Paul Eggert |
Subject: | bug#32252: [PATCH] %o and %x now format signed numbers |
Date: | Tue, 24 Jul 2018 17:54:57 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Eli Zaretskii wrote:
Do we really need to have identical or consistent behavior for fixnums and bignums? They are different beasts, so the behavior could be different, provided that it makes sense for each of the varieties.
I don't know what inconsistent behavior would make sense here. There's a longstanding tradition in Lisp that integer arithmetic just works, and I don't see why Emacs would want to fight against that tradition here. Although there may be some low-level functions that distinguish between fixnums and bignums for efficiency reasons, the vast majority of Lisp functions should not distinguish them, and 'format' should be one of those functions.
Maybe we should merge the branch first, let the dust settle and let people use the new functionality, then revisit this stuff with more experience on our hands.
This particular patch is not primarily about bignums. It's more about (read (printf "#x%x" N)) returning N, which is basic functionality that should work even if we never add bignums. The fact that the patch also will make bignums easier is just icing on the cake.
Although I understand the concern about the patch, the concern doesn't seem to be warranted, and any compatibility issues can easily be addressed by setting binary-as-signed.
[Prev in Thread] | Current Thread | [Next in Thread] |