|
From: | Kaushal |
Subject: | Re: Update assq-delete-all to support keys of string type |
Date: | Tue, 12 May 2015 13:09:08 -0400 |
Kaushal <address@hidden> wrote:
> I wanted to use assq-delete-all to remove all elements in an alist whose car
> matched a string.
>
> Example alist:
>
> (setq temp-alist '(("a" . 1) ("b" . 2)))
>
> Currently I cannot do
>
> (setq temp-alist (assq-delete-all "a" temp-alist))
>
> Is there a right way to do this?
You can do this with `cl-remove':
(cl-remove "a"
'(("a" . 1) ("b" . 2))
:key #'car
:test #'string=) ;=> (("b" . 2))
--
john
[Prev in Thread] | Current Thread | [Next in Thread] |