From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Naoya Yamashita Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add gv-define-expander for plist-get Date: Thu, 27 Aug 2020 13:35:44 +0900 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d7c45805add47814" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29135"; mail-complaints-to="usenet@ciao.gmane.io" To: "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 27 06:36:31 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kB9eI-0007Um-Oo for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Aug 2020 06:36:30 +0200 Original-Received: from localhost ([::1]:42280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB9eH-00076G-Lc for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Aug 2020 00:36:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB9dn-0006eV-AY for emacs-devel@gnu.org; Thu, 27 Aug 2020 00:35:59 -0400 Original-Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:34847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB9dl-0001Sg-QG for emacs-devel@gnu.org; Thu, 27 Aug 2020 00:35:59 -0400 Original-Received: by mail-pj1-x1042.google.com with SMTP id g6so1955157pjl.0 for ; Wed, 26 Aug 2020 21:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=+chANM0f5VG0ykrE1st8ok6NXVVTqL1BOx0mHiWDWhc=; b=p62iUj/VBfWtx4q9k429O7Khdav5WQ7me/WS0Mrjbuvnh3mQfa2xl1GFY2izfUB2Di /d1ZZ4kfucItT5sqX7Jphx70081So7pQuN+3c+bEbv2DuavwjcG5Ky/vLh7mTv+Y5I6Q NkZS6fymBPKOhBCKkH4ol3JWxshSQ985rV5h6cvv5F0AgYwXm5b5M1I2HC9Dy5j3WDBD WX0vriix7Qxg4Dl1W2BZlTwNBVJLwQ3m8CH5a7RstcgU1dVrsf+YLBw7/ziK5vhU+iA6 VIruXJFDHY98aArOpwvb9oxXVBIjhH9A33OdX8XonnEsQPI6xlLrcaYDTMxMsuXpomHO tJoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=+chANM0f5VG0ykrE1st8ok6NXVVTqL1BOx0mHiWDWhc=; b=j1xtH0Z9V+bRjeBlE/viSr8IM8AfCL90lo5Ul7IN3Op0jtuvS4wMFv22ZwTNqaPOmR HsU+1e9pZAX5eNq0+lKkC9kib69A31T5ktKP3jait/3+Ydeg8Kd30794HimsKUvw8sGY ZGEpERobiUHG1OgwnMh8flOIOXaQU13nEy+MPrVaO7pYFWLcV6tFun90zKQAGFIYFQao tT7Ay/355x/S8G7ek8IzBmcKffemtkZc3rJxG9je6cNf36LuSPJ5Nva662aTxXJVammQ Q8HM1NzmktOufsqWp7kPSs+GjU4csDrBhkED6AqqcZpYizAHh6VaC+c7oIQMyCUkKukI d7Ug== X-Gm-Message-State: AOAM533zgwoMjhzhy+ylTFUgyJedm5eSk5VqHl8BLr36Z00R9i9Vw96a X90L+/8vDIjbnt4Tv7ehHeryNFEX4Ob33YKaaCPdDK5/w6UN9A== X-Google-Smtp-Source: ABdhPJyZfR/tctH8ZbkGPnbuD/K5Q/Cndo0t32rMG0pem95MDwzGs1Zhkf2joVyMGNyhy36rZfcSpy5Std/gbMnAhBs= X-Received: by 2002:a17:90a:e017:: with SMTP id u23mr4984161pjy.96.1598502955629; Wed, 26 Aug 2020 21:35:55 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=conao3@gmail.com; helo=mail-pj1-x1042.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:254271 Archived-At: --000000000000d7c45805add47814 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Does anyone see this email? Let me know if there's a better place to put this patch out. Excuse me, I'm not used to communicating on ML... 2020=E5=B9=B48=E6=9C=8817=E6=97=A5(=E6=9C=88) 18:05 Naoya Yamashita : > Hello, all. > > I find `gv` has `gv-define-expander` for `alist-get`, but > there're no definition for `plist-get` > > Therefore, `setf` works only for `alist-get` but not for > `plist-get`. > > ``` > (let ((target '((a . "a") (b . "b")))) > (setf (alist-get 'a target) "modify") > target) > ;;=3D> ((a . "modify") (b . "b")) > > (let ((target '(:a "a" :b "b"))) > (setf (plist-get target :a) "modify") > target) > ;;=3D> Debugger entered--Lisp error: (void-function \(setf\ plist-get\)) > ;; (\(setf\ plist-get\) "modify" v :a) > ;; (let* ((v v)) (\(setf\ plist-get\) "modify" v :a)) > ;; (setf (plist-get v :a) "modify") > ;; (let ((v '(:a "a" :b "b"))) (setf (plist-get v :a) "modify")) > ;; (progn (let ((v '(:a "a" :b "b"))) (setf (plist-get v :a) > "modify"))) > ;; eval((progn (let ((v '(:a "a" :b "b"))) (setf (plist-get v :a) > "modify"))) t) > ``` > > This patch adds the definition of gv-expander for `plist-get`. > Please refer to the additional test cases for usage. > > > --000000000000d7c45805add47814 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Does anyone see this email?
Let me know if = there's a better place to put this patch out.
Excuse me, I= 9;m not used to communicating on ML...

2020=E5=B9=B48=E6=9C=8817=E6=97= =A5(=E6=9C=88) 18:05 Naoya Yamashita <conao3@gmail.com>:
Hello, all.

I fi= nd `gv` has `gv-define-expander` for `alist-get`, but
there're no de= finition for `plist-get`

Therefore, `setf` works only for `alist-get= ` but not for
`plist-get`.

```
(let ((ta= rget '((a . "a") (b . "b"))))
=C2=A0 (setf (alis= t-get 'a target) "modify")
=C2=A0 target)
;;=3D> ((a= . "modify") (b . "b"))

(let ((target '(:a &= quot;a" :b "b")))
=C2=A0 (setf (plist-get target :a) &quo= t;modify")
=C2=A0 target)
;;=3D> Debugger entered--Lisp error= : (void-function \(setf\ plist-get\))
;; =C2=A0 =C2=A0 (\(setf\ plist-ge= t\) "modify" v :a)
;; =C2=A0 =C2=A0 (let* ((v v)) (\(setf\ pli= st-get\) "modify" v :a))
;; =C2=A0 =C2=A0 (setf (plist-get v := a) "modify")
;; =C2=A0 =C2=A0 (let ((v '(:a "a" = :b "b"))) (setf (plist-get v :a) "modify"))
;; =C2= =A0 =C2=A0 (progn (let ((v '(:a "a" :b "b"))) (setf= (plist-get v :a) "modify")))
;; =C2=A0 =C2=A0 eval((progn (le= t ((v '(:a "a" :b "b"))) (setf (plist-get v :a) &qu= ot;modify"))) t)
```

This patch adds the d= efinition of gv-expander for `plist-get`.
Please refer to the additional= test cases for usage.


--000000000000d7c45805add47814--