From: Kaushal <kaushal.modi@gmail.com>
To: John Mastro <john.b.mastro@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Update assq-delete-all to support keys of string type
Date: Tue, 12 May 2015 13:09:08 -0400 [thread overview]
Message-ID: <CAFyQvY27ekSbX5Z2rQA+0AV+is5+qbPuwwr5BmMd7m_0uB5GDg@mail.gmail.com> (raw)
In-Reply-To: <CAOj2CQSH1QxXYXUZA1fAAqb5QitegycArrxQj0cKhU99uKZtcg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 634 bytes --]
Thanks!
--
Kaushal Modi
On Tue, May 12, 2015 at 1:02 PM, John Mastro <john.b.mastro@gmail.com>
wrote:
> Kaushal <kaushal.modi@gmail.com> 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
>
[-- Attachment #2: Type: text/html, Size: 1496 bytes --]
next prev parent reply other threads:[~2015-05-12 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 14:57 Update assq-delete-all to support keys of string type Kaushal
2015-05-12 17:02 ` John Mastro
2015-05-12 17:09 ` Kaushal [this message]
2015-05-13 0:13 ` Stephen J. Turnbull
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFyQvY27ekSbX5Z2rQA+0AV+is5+qbPuwwr5BmMd7m_0uB5GDg@mail.gmail.com \
--to=kaushal.modi@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=john.b.mastro@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.