[Top][All Lists]

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

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

From: Naoya Yamashita
Subject: [PATCH] Add gv-define-expander for plist-get
Date: Mon, 17 Aug 2020 18:05:54 +0900

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.

Attachment: 0001-Add-gv-define-expander-for-plist-get.patch
Description: Text Data

reply via email to

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