[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add gv-define-expander for plist-get

From: Naoya Yamashita
Subject: Re: [PATCH] Add gv-define-expander for plist-get
Date: Thu, 27 Aug 2020 13:35:44 +0900

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

(let ((target '((a . "a") (b . "b"))))
  (setf (alist-get 'a target) "modify")
;;=> ((a . "modify") (b . "b"))

(let ((target '(:a "a" :b "b")))
  (setf (plist-get target :a) "modify")
;;=> 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.

reply via email to

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