emacs-devel
[Top][All Lists]
Advanced

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

Re: Update assq-delete-all to support keys of string type


From: Kaushal
Subject: Re: Update assq-delete-all to support keys of string type
Date: Tue, 12 May 2015 13:09:08 -0400

Thanks!


--
Kaushal Modi

On Tue, May 12, 2015 at 1:02 PM, John Mastro <address@hidden> wrote:
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


reply via email to

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