unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>,
	"Juanma Barranquero" <lekktu@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>,
	"Dr. Arne Babenhauserheide" <arne_bab@web.de>
Subject: RE: [External] : Re: Warn about comparing quoted lists (etc) using `eq`
Date: Thu, 15 Dec 2022 16:13:14 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488449E41EFB164FB4CF2CCF3E19@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <58A7E984-95CC-4F7F-817B-10E680E5966E@gmail.com>

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



      parent reply	other threads:[~2022-12-15 16:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 18:17 Warn about comparing quoted lists (etc) using `eq` Mattias Engdegård
2022-12-14 18:29 ` Eli Zaretskii
2022-12-14 20:57   ` Mattias Engdegård
2022-12-14 18:57 ` [External] : " Drew Adams
2022-12-15  4:17 ` Juanma Barranquero
2022-12-15  6:34   ` Dr. Arne Babenhauserheide
2022-12-15  7:00     ` Juanma Barranquero
2022-12-15  9:36   ` Mattias Engdegård
2022-12-15 10:06     ` Juanma Barranquero
2022-12-15 10:50     ` Ihor Radchenko
2022-12-15 13:58       ` Mattias Engdegård
2022-12-15 16:13     ` Drew Adams [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488449E41EFB164FB4CF2CCF3E19@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=arne_bab@web.de \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=mattias.engdegard@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).