GNU bug report logs -
#47368
28.0.50; map-elt returns nil without "deprecated" TESTFN
Previous Next
Reported by: dalanicolai <dalanicolai <at> gmail.com>
Date: Wed, 24 Mar 2021 22:54:02 UTC
Severity: normal
Tags: patch
Found in versions 28.0.50, 27.1
Fixed in version 28.1
Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Bug is archived. No further changes may be made.
Full log
Message #43 received at 47368 <at> debbugs.gnu.org (full text, mbox):
> >> > This is expected, as alist keys are tested with eq by default.
> >
> > Since when?
>
> Since the introduction of map.el in Emacs 25.
The general statement you made, that alist keys are treated with eq by default, is false, AFAIK. That may be true of `map-elt', but it's not true in general (AFAIK).
> > Where? Expected by whom, and by what code?
>
> By the function being discussed.
Does the doc string of the function being discussed, `map-elt' say this? Does it say anything at all about how keys are compared?
I have only Emacs 27.1 - the latest release available on MS Windows, and there the doc string says NADA about how keys are compared. Nothing about what it means for "if KEY is not found".
At the very least, if such is still the case then the doc needs to updated to specify how keys are compared, IMHO.
I'm hoping that doc more recent than Emacs 27.1 already takes care of this. You say, for example:
That's what the docstring is trying to warn about:
alists default to testing with eq, but can also use
eql, equal, or anything else.
I don't see (in 27.1) where the doc string warns about
any such thing. Nothing about eq being the default,
and nothing about testing being also possible with the
others you mention.
Not only that, but the doc string says that TESTFN
is deprecated, but there's no other mention of TESTFN.
What's TESTFN? Where is it specified? It's not part
of the function signature that's shown. How can you
refer to it if there's no indication anywhere here of
what it is? This makes no sense to me.
And why is there this line at the end of the doc string?
Undocumented
What on earth is that supposed to mean to a reader of
the `map-elt' doc?
This bug report was last modified 3 years and 329 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.