emacs-devel
[Top][All Lists]
Advanced

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

Re: master 64109fcae7 2/3: indent-for-tab-command: Deal with large point


From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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




reply via email to

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