From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST function Date: Sun, 28 Mar 2021 15:12:40 +0200 Message-ID: <87v99b5smv.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36300"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Nicolas Petton , 47425@debbugs.gnu.org, Stefan Monnier To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 28 15:14:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQVF5-0009Kr-4x for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 15:14:11 +0200 Original-Received: from localhost ([::1]:38912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQVF3-0002i9-Pw for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 09:14:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQVEx-0002hy-DU for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 09:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQVEx-0004ip-6g for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 09:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lQVEx-00027L-2N for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 09:14:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Mar 2021 13:14:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47425 X-GNU-PR-Package: emacs Original-Received: via spool by 47425-submit@debbugs.gnu.org id=B47425.16169371878047 (code B ref 47425); Sun, 28 Mar 2021 13:14:03 +0000 Original-Received: (at 47425) by debbugs.gnu.org; 28 Mar 2021 13:13:07 +0000 Original-Received: from localhost ([127.0.0.1]:45543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQVE2-00025i-Kf for submit@debbugs.gnu.org; Sun, 28 Mar 2021 09:13:07 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:55406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQVE1-00024o-1f for 47425@debbugs.gnu.org; Sun, 28 Mar 2021 09:13:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=usDOo5WvOaWSkqG3tyDkXER53pGrTTmDV8lv4vmPWo8=; b=b/z7xZLjb9XxBgtTE3DKGfDKkk fLNMl9fNhRmbsU9CT12rhqo6GMkyFFjr0ISCa30ry2p1C2WpQkl9wCqKWfM/tb6/TtjrNpTmnTb7x xyBq6qhh4Qxi1hpJoyYjg//0QY3SB7ItTw4kBpmAFJFx/aRHHxw5mWNLDg3LIpfiWvi4=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQVDd-0002A7-Sk; Sun, 28 Mar 2021 15:12:52 +0200 X-Now-Playing: Bobbie Gentry's _The Girl From Chickasaw County (5): Touch 'Em With Love_: "Spinning Wheel" In-Reply-To: (Drew Adams's message of "Fri, 26 Mar 2021 22:13:42 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203159 Archived-At: Drew Adams writes: > 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. 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. Sure (map-put! (list 'a 1) 'b 2) works fine, but you can't create a plist that way, which makes these functions barely usable at all for handling plists/alists: (map-put! nil 'b 2) will signal an error. So does anybody have an opinion here? I think I'm in favour of adding a comparison function for all three `plist-*' functions. Drew Adams writes: > 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.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no