emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Warn about comparing quoted lists (etc) using `eq`


From: Drew Adams
Subject: RE: [External] : Re: Warn about comparing quoted lists (etc) using `eq`
Date: Thu, 15 Dec 2022 16:13:14 +0000

> > I miss a suggestion, though: the warning as it is is not actionable. It
> > would be great if it could say something along the lines of
> >
> > "... (arg 2). Consider using `equal'."

Dunno what the "... (arg 2)" is about, but the
rest of that looks like a suggestion I made here:

  The warning could perhaps remind users of `equal'.

  It's likely that in at least some cases what they
  really meant was (equal x '(ho hum)).  And `equal'
  takes care of all types (strings etc.).


> While this sounds like a useful suggestion on the surface, it's actually
> slightly dangerous: blindly replacing `eq` with `equal` (and `memq` with
> `member`, and so on)

No one (at least not I) suggested such a thing.

Neither my "remind" suggestion nor the quoted (?)
"consider" suggestion imply or even suggest
anything like "blindly replacing".

The point (my point at least) was that some users
might mistakenly use `eq' when they really meant
(should have meant) `equal', and a reminder about
the difference might help then.

On the other hand, I'm not a big fan of _warnings_
(apart from byte-compiler messages, and even then
most shouldn't be considered _warnings_).

> What we really want is to make a human look at
> the code, and think.

Precisely.  And when doing so, at least be aware
that `equal' exists and how it's different from
`eq'.  To some users (esp. new users) that may
not be obvious or front-of-mind.



reply via email to

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