From: Naoya Yamashita <conao3@gmail.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: [PATCH] Add gv-define-expander for plist-get
Date: Thu, 27 Aug 2020 13:35:44 +0900 [thread overview]
Message-ID: <CAEPcJakepk+Px807yn791xXB29TMKaf8whVznsFUz6x36gbaHg@mail.gmail.com> (raw)
In-Reply-To: <CAEPcJan65rEkumAf5e335X9tUjo4Mmq1v-xP7KJv6-mPfUDv2w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
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年8月17日(月) 18:05 Naoya Yamashita <conao3@gmail.com>:
> 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)
> ;;=> ((a . "modify") (b . "b"))
>
> (let ((target '(:a "a" :b "b")))
> (setf (plist-get target :a) "modify")
> target)
> ;;=> 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.
>
>
>
[-- Attachment #2: Type: text/html, Size: 1927 bytes --]
next prev parent reply other threads:[~2020-08-27 4:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-17 9:05 [PATCH] Add gv-define-expander for plist-get Naoya Yamashita
2020-08-27 4:35 ` Naoya Yamashita [this message]
2020-09-05 18:03 ` Stefan Monnier
2020-09-09 1:03 ` Naoya Yamashita
2020-09-09 3:23 ` Stefan Monnier
2020-09-09 12:32 ` Naoya Yamashita
2020-09-09 17:51 ` Stefan Monnier
2020-09-09 20:08 ` Naoya Yamashita
2020-09-10 12:40 ` Adam Porter
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEPcJakepk+Px807yn791xXB29TMKaf8whVznsFUz6x36gbaHg@mail.gmail.com \
--to=conao3@gmail.com \
--cc=emacs-devel@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.