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

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 26 Mar 2021 22:14:01 UTC

Severity: wishlist

Found in version 26.3

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Nicolas Petton <nicolas <at> petton.fr>, "47425 <at> debbugs.gnu.org" <47425 <at> debbugs.gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#47425: [External] : Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST function
Date: Sun, 28 Mar 2021 16:43:19 +0000
> > 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'.
> 
> plist-put doesn't ensure that the operation makes sense here, no, but we
> can't really add that at this point, either.

Please elaborate.  I don't know what you're saying,
or why.

> I think adding a comparison function makes sense, but on the other
> hand -- we seem to be moving towards using map.el more for these things
> now, so I'm not sure there's much enthusiasm for that.  On the other
> hand, the generic map functions have the problem that they...  can't
> really be used like plist-put.

No.  Please do _not_ bring generic mapping into this.
This is a legitimate issue about plists and plist
functions.

> So does anybody have an opinion here?  I think I'm in favour of adding a
> comparison function for all three `plist-*' functions.

+1. 

> > That would also mean we wouldn't need `lax-plist-*' functions.
> 
> Yes, those are horrible functions, and are barely used anywhere.  (And
> `lax-plist-member' is missing.)

Agreed.  But their existence is an argument that the
intention was to provide for the use of `equal' as
an alternative test pred to `eq'.




This bug report was last modified 3 years and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.