all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: Robert Pluim <rpluim@gmail.com>,
	 Philipp Stephani <phst@google.com>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: master 64109fcae7 2/3: indent-for-tab-command: Deal with large point or modiff values.
Date: Mon, 17 Jan 2022 14:55:23 -0500	[thread overview]
Message-ID: <jwvzgnudy2i.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAArVCkTWqCjcdSSEq6vTBQJQ=Orra2-ATxHOv_N_UXM+OsMZ-A@mail.gmail.com> (Philipp Stephani's message of "Mon, 17 Jan 2022 18:23:07 +0100")

>> You could use '=' here, no, just to emphasise the point that these are integers?
> Yeah, they have identical semantics for integers. I tend to prefer eql
> since its overall semantics are simpler

Agreed.  `=` can signal an error and obeys the NaN corner cases as
dictated by IEEE so I usually prefer `eql`.

> (but the manual disagrees and says that = should be preferred).

Can't agree on everything.

> Iʼm a simple man: I can retain the difference between `eq' and
> 'equal', but throwing `eql' into the mix is just too much :-)

It's easy: just always use `eql` instead of `eq`.
They only differ in two cases:
- `eql` gives you the answer you expected and `eq` gives an answer that
  baffles you.
- your code is *really* naughty.
`eq` can be marginally faster, but the difference is so small that it's
only noticeable when it's called from C in a tight loop, like maybe when
comparing `memq` and `memql` but not when calling `eq` vs `eql` from
ELisp where the actual overhead of interpreting the byte code is large
enough to dwarf the difference of the execution of the op itself.


        Stefan




  parent reply	other threads:[~2022-01-17 19:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <164219059635.16941.2631797019964844711@vcs2.savannah.gnu.org>
     [not found] ` <20220114200316.CB79BC0DA30@vcs2.savannah.gnu.org>
2022-01-17 13:38   ` master 64109fcae7 2/3: indent-for-tab-command: Deal with large point or modiff values Robert Pluim
2022-01-17 17:23     ` Philipp Stephani
2022-01-17 17:29       ` Robert Pluim
2022-01-17 19:55       ` Stefan Monnier [this message]
2022-01-17 21:35         ` Mattias Engdegård
2022-01-17 22:25           ` Stefan Monnier

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=jwvzgnudy2i.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=p.stephani2@gmail.com \
    --cc=phst@google.com \
    --cc=rpluim@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.