Elisp: How to delete an element from an association list with string key

后端 未结 4 1279
执念已碎
执念已碎 2021-02-07 06:54

Now this works just fine:

(setq al \'((a . \"1\") (b . \"2\")))
(assq-delete-all \'a al)

But I\'m using strings as keys in my app:



        
4条回答
  •  梦毁少年i
    2021-02-07 07:12

    If using emacs 25 or newer you can use alist-get

    (setf (alist-get "a" al t t 'equal) t)

提交回复
热议问题