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

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

bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST function


From: Jean Louis
Subject: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST function
Date: Sat, 27 Mar 2021 10:16:35 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* Drew Adams <drew.adams@oracle.com> [2021-03-27 01:15]:
> Please consider adding a TEST comparer arg for plist keys.
> 
> In Elisp, a plist key need not be a symbol:
> 
> (plist-put (list "aaa" 1 "bbb" 2 "ccc" 3) "bbb" 42)
> 
> That "works" (and no error), but it doesn't do what's expected, since
> the keys should be compared with `equal' or `string=', not `eq'.
> 
> And if it were not intended that that work then Elisp would raise a
> wrong-type-argument error saying that the first arg isn't a plist.
> 
> And note that the Elisp manual says:
> 
>   A "property list" ("plist" for short) is a list of
>   paired elements.  Each of the pairs associates a
>   property name (usually a symbol) with a property or value.
>                  ^^^^^^^

That is right, I always had that problem with plist, and still
do. Amount of the coping code on my side would become redundant if
that would be corrected to have a test function.





reply via email to

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