unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "rms@gnu.org" <rms@gnu.org>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: "mattiase@acm.org" <mattiase@acm.org>,
	"p.stephani2@gmail.com" <p.stephani2@gmail.com>,
	"nicolas@petton.fr" <nicolas@petton.fr>,
	"47425@debbugs.gnu.org" <47425@debbugs.gnu.org>,
	"monnier@iro.umontreal.ca" <monnier@iro.umontreal.ca>
Subject: bug#47425: 26.3; `plist-get', `plist-put' and proposed TEST function
Date: Wed, 29 Jun 2022 05:11:05 +0000	[thread overview]
Message-ID: <SJ0PR10MB54884E60D84D72B99B7EE761F3BB9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <E1o6OSS-0005cM-BT@fencepost.gnu.org>

> CL-style keyword arguments to modify list operations are clunky.
> Unless we implement them in an extra-complicated way, they will slow
> down the usual case, too.  I understand the motivation for proposing
> this change, but let's solve it in a cleaner way that doesn't invite
> copying the bad designs of CL.

I don't think this bug thread has anything to
do with keyword arguments or even with keywords
(e.g. :foobar) in any other way.  Keywords are
anyway symbols, so they compare fine with `eq'.

The suggestion was to add a TEST optional arg,
not a keyword :test arg.  IOW, follow what we
usually do in Emacs Lisp.

The motivation here is to support plists with
keys, such as strings, that can't be usefully
compared with `eq'.

> Here are two ways that occur to me.
> 
> * The applications that want to compare property names with `equal'
> could canonicalize those names.  For instance, intern the strings
> you want to use as property names, perhaps in a special obarray.
> Then you can use `plist-get' and `plist-put' on them and get the
> results you want.

Someone writing code from scratch can always
use symbols as keys (plist properties).  That's
not the problem.

The idea is to support existing plists that
have string keys.  (And some users will end up
with such plists, one way or another.)

> * Define functions `plist-get-equal' and `plist-put-equal'.
> Instead of complicating the definitions of widely used functions
> `plist-get' and `plist-put', it will define two new functions
> that most users won't need to pay attention to.

That solution is OK also.  That won't help
someone who comes across plist-get and -put
and mistakenly tries to use them with string
keys, but that's OK.  (After all, we have memq
and member...)


  reply	other threads:[~2022-06-29  5:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 22:13 bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST function Drew Adams
2021-03-26 22:16 ` Drew Adams
2021-03-27  7:16 ` Jean Louis
2021-03-28 13:12 ` Lars Ingebrigtsen
2021-03-28 16:43   ` bug#47425: [External] : " Drew Adams
2021-03-28 19:20   ` Philipp
2021-03-28 19:27     ` Lars Ingebrigtsen
2022-06-27 10:22       ` Lars Ingebrigtsen
2022-06-27 11:31 ` Mattias Engdegård
2022-06-27 11:43   ` Lars Ingebrigtsen
2022-06-27 12:18     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-27 12:27       ` Mattias Engdegård
2022-06-27 12:44         ` Lars Ingebrigtsen
2022-06-27 13:28           ` Mattias Engdegård
2022-06-27 13:35             ` Lars Ingebrigtsen
2022-06-27 15:11               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-27 15:18                 ` Lars Ingebrigtsen
2022-06-27 14:39             ` Drew Adams
2022-06-27 14:39         ` Drew Adams
2022-06-27 12:41       ` Lars Ingebrigtsen
2022-06-27 14:39         ` Drew Adams
2022-06-27 14:39       ` Drew Adams
2022-06-27 15:09         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-27 17:07           ` Drew Adams
2022-06-27 17:19             ` Mattias Engdegård
2022-06-27 17:22               ` Lars Ingebrigtsen
2022-06-28 15:23                 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-28 15:40                   ` Lars Ingebrigtsen
2022-06-29  3:33                 ` bug#47425: 26.3; `plist-get', `plist-put' and proposed " Richard Stallman
2022-06-29  5:11                   ` Drew Adams [this message]
2022-06-30  3:10                     ` Richard Stallman
2022-06-27 17:41               ` bug#47425: 26.3; `plist-get', `plist-put' should accept a " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB54884E60D84D72B99B7EE761F3BB9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=47425@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=mattiase@acm.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nicolas@petton.fr \
    --cc=p.stephani2@gmail.com \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).