help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: [External] : Re: Emacs 30.0 warning from `cl-pushnew' and `memql'


From: Drew Adams
Subject: RE: [External] : Re: Emacs 30.0 warning from `cl-pushnew' and `memql'
Date: Wed, 28 Dec 2022 17:54:34 +0000

> I think the interpretation of the question "Could there be a better
> default comparison function?", in the sense that `eql' is a bit nicer
> than `eq' for specific value types, is valid, especially when
> considering that `cl-pushnew' is often used for configuration stuff or
> other purposes where speed is not crucial.

If Emacs wants to have its own `pushnew' macro
then its definition can and should do whatever
is best for Emacs.  But if Emacs wants to have
a macro that emulates CL's `pushnew', and thus
call it `cl-pushnew', then it should behave as
much as possible like CL's `pushnew'.  And
that includes defaulting to using `eql'.

IOW, don't think about what default predicate
would be best for Elisp, for `cl-pushnew'.
Think instead about what default predicate CL
uses for `pushnew'.  That's what emulation is
about.

BTW, this isn't a guideline to "protect CL" or
something.  It's a guideline for the benefit of
Elisp: clearly identify what's CL emulation and
what's not.

And yes, Elisp can and perhaps should directly
include some more CL macros as its own (doing
whatever's best for Elisp, and not bothering
to best emulate the CL version).  This could
apply to `pushnew'.
___

And it applies to `case', IMHO.  Encouraging or
coercing folks to use `pcase' or `cond' just to
handle the simple and common case of `case' is
overkill.



reply via email to

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