bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39557: 27.0.60; Elisp manual, doc about bignums


From: Drew Adams
Subject: bug#39557: 27.0.60; Elisp manual, doc about bignums
Date: Thu, 13 Feb 2020 13:03:46 -0800 (PST)

> > 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]