From: Drew Adams <drew.adams@oracle.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 39557@debbugs.gnu.org
Subject: bug#39557: 27.0.60; Elisp manual, doc about bignums
Date: Thu, 13 Feb 2020 13:03:46 -0800 (PST) [thread overview]
Message-ID: <2cf08bc2-be80-4943-9e1c-20a4b594950c@default> (raw)
In-Reply-To: <85ftfexs5s.fsf@gmail.com>
> > 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.
next prev parent reply other threads:[~2020-02-13 21:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-10 23:55 bug#39557: 27.0.60; Elisp manual, doc about bignums Drew Adams
2020-02-11 17:01 ` Eli Zaretskii
2020-02-11 21:46 ` Noam Postavsky
2020-02-11 22:34 ` Drew Adams
2020-02-12 15:53 ` Noam Postavsky
2020-02-12 21:36 ` Drew Adams
2020-02-13 18:23 ` Noam Postavsky
2020-02-13 21:03 ` Drew Adams [this message]
2020-02-12 20:06 ` Richard Stallman
2020-02-13 23:43 ` Richard Stallman
2020-02-17 22:05 ` Paul Eggert
2020-02-17 23:19 ` Drew Adams
2020-02-17 23:52 ` Paul Eggert
2020-02-18 1:52 ` Drew Adams
2020-02-18 3:13 ` Paul Eggert
2020-09-25 11:18 ` Lars Ingebrigtsen
[not found] <<3d420026-bb32-413f-9a9c-304240aa82e2@default>
[not found] ` <<8336bhrrb4.fsf@gnu.org>
2020-02-11 18:26 ` Drew Adams
2020-02-11 19:14 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2cf08bc2-be80-4943-9e1c-20a4b594950c@default \
--to=drew.adams@oracle.com \
--cc=39557@debbugs.gnu.org \
--cc=npostavs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.