GNU bug report logs -
#39557
27.0.60; Elisp manual, doc about bignums
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Mon, 10 Feb 2020 23:56:01 UTC
Severity: wishlist
Found in version 27.0.60
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 39557 <at> debbugs.gnu.org (full text, mbox):
> > to the technical content - the problem
> > reported? Any thoughts on that?
>
> The idea is recommend using eql for comparing integers first, and move
> the description of eq and fixnum/bignum distinction to the next
> paragraph, right?
Almost. Recommend `eql' generally for integers, even
as, i.e., even _after_, pointing out that integers
are either fixnums or bignums. IOW, it's a general
recommendation, regardless of the fact that there
are two kinds of integers.
And in fact point out that you CANNOT use `eq', in
general, to compare integers. That's part of the
point about recommending `eql'. The recommendation
is in spite of the fact that there are two kinds of
integers - it applies to integers of both kinds, and
`eq' cannot be used with integers of both kinds.
And somewhere after that (whether the next paragraph
or not), get into the fact that you can use `eq' (in
addition to `eql') to compare two fixnums (BOTH must
be known to be fixnums) - IF you think it's important
to point that out.
I think it's important to point out that you can
_distinguish_ a fixnum from a bignum, and how to do
that.
But I can't say whether it's really important, in
this doc, to say that you can compare two fixnums
using `eq'. A priori, I'd think not.
As I said earlier, AFAIK that's only an optimization,
and anyone who is liable to use/need such optimizing
should already know that `eq' is faster than `eql'.
I don't think that _this_ doc needs to or should
point out that `eql' is "more-heavyweight" than
`eq'. That's not specific to integer comparison.
To be clear, I have no objection to saying that
you can use `eq' for two fixnums. I'm just not
aware of why it's important to do that in this doc.
> And also to document when the reader returns fixnums or bignums. Though
> I guess that might instead be solved by making the rule you cited
> stronger to something like:
>
> Emacs always represents integers in fixnum range
> as a fixnum, not a bignum.
>
> (Assuming that's true, which I believe it is)
Yes, that would be OK, provided we don't speak of
"computing" the integer, which can be misleading
for a literal (a numeral), or provided we make
clear that that rule applies also to numerals.
Thanks for working on this fix, if you do.
This bug report was last modified 4 years and 240 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.