[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Update assq-delete-all to support keys of string type
From: |
John Mastro |
Subject: |
Re: Update assq-delete-all to support keys of string type |
Date: |
Tue, 12 May 2015 10:02:06 -0700 |
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