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: Drew Adams
Subject: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST function
Date: Mon, 27 Jun 2022 17:07:16 +0000

> > Plists with, e.g., string keys aren't uncommon
>
> Really?  Can you give examples?

Maybe I could, but I won't try.  I take it that
you don't think so.  That's fine.

My expectation is that more users nowadays may
be inclined to use string keys than in the past,
because (as I said) of the influence of things
like JSON.  This enhancement request is to cater
to what I expect will not be all that uncommon.

And there may be more and more use of conversion
of alists (which do often have nonsymbol keys)
to plists.  For whatever reasons (good & bad).

Note too, BTW, that (not uncommon) != common.
___

CLTL2, "The Property List" says, in passing,
that `symbol-plist' keys are "typically" symbols.
It doesn't say that they _are_ symbols.

And it doesn't say anywhere that they need to
be distinguishable with just `eq'.

In any case, I'll grant you that using symbol
keys _is_ common.  (The same is true of alist
keys, BTW.)
___

BTW, CLTL2 also points to this as the essential
difference between a plist and an alist:

  a property list is an object with a unique
  identity; the operations for adding and
  removing property-list entries are destructive
  operations that alter the property list rather
  than making a new one. Association lists, on
  the other hand, are normally augmented
  non-destructively (without side effects) by
  adding new entries to the front (see acons and
  pairlis).

No mention of plist keys being symbols.

However, it's also true that CL defines `remprop'
as using `eq'.





reply via email to

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