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: Thu, 29 Dec 2022 22:27:53 +0000

> > `cl-pushnew' should be an emulation of Common Lisp `pushnew' -
> > neither more nor less.
> >
> > I'm not sure what your point is, but `pushnew' defaults to using
> > `eql', not `equal' (or `string='). So if you want `pushnew' to
> > compare strings then yes, you should pass a predicate such as
> > `string=' (or `equal').
> 
> It's much better if the function itself checks what type the value
> is of and pick a suitable function to compare from that, then the
> user don't have to think about that at all.

Again, `cl-case` came from CL `case' (and that
came from other Lisps).

Elisp is of course free to do whatever it wants.
It could add an optional TEST predicate arg etc.

Checking the "type the value is of" is problematic.
For one thing, you might well want to control the
type of the arg so that it just fit the predicate
you want used (e.g. `eql' in the current case).

And some values are of multiple types.  E.g., nil's
a symbol and a list.  And some types are subtypes
of other types.  E.g. lists are sequences.



reply via email to

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