From: Michael Heerdegen <michael_heerdegen@web.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get'.
Date: Tue, 19 Jan 2016 20:25:47 +0100 [thread overview]
Message-ID: <87egddid6s.fsf@web.de> (raw)
In-Reply-To: <m24me9mmvi.fsf@newartisans.com> (John Wiegley's message of "Tue, 19 Jan 2016 10:42:57 -0800")
John Wiegley <jwiegley@gmail.com> writes:
> The old way:
>
> GET: (cdr (assq key my-alist))
> SET: (setcdr (assq key my-alist) new-value)
>
> The new hotness:
>
> GET: (alist-get key my-alist)
> SET: (setf (alist-get key my-alist) new-value)
That's only one half of the truth: Your two SETs are different if KEY is
not yet present in MY-ALIST. "The old way" doesn't work in that case,
the new one does. It replaces a complete
(if (assq ...)
(setcdr ... ...)
(push ... ...))
Michael.
next prev parent reply other threads:[~2016-01-19 19:25 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160116143238.27391.97533@vcs.savannah.gnu.org>
[not found] ` <E1aKRuA-00078P-4T@vcs.savannah.gnu.org>
2016-01-19 9:53 ` emacs-25 2460cfa: * doc/lispref/lists.texi (Association Lists): Document 'alist-get' Michael Heerdegen
2016-01-19 17:45 ` Eli Zaretskii
2016-01-19 17:59 ` John Wiegley
2016-01-20 7:31 ` Yuri Khan
2016-01-20 7:40 ` John Wiegley
2016-01-20 9:33 ` Eli Zaretskii
2016-01-19 18:01 ` Michael Heerdegen
2016-01-19 18:32 ` Eli Zaretskii
2016-01-19 18:42 ` John Wiegley
2016-01-19 19:06 ` Eli Zaretskii
2016-01-19 19:25 ` Michael Heerdegen [this message]
2016-01-19 19:33 ` Stefan Monnier
2016-01-19 18:52 ` Michael Heerdegen
2016-01-19 19:17 ` Eli Zaretskii
2016-01-19 19:34 ` Michael Heerdegen
2016-01-19 19:46 ` Eli Zaretskii
2016-01-19 20:09 ` John Wiegley
2016-01-20 12:14 ` Michael Heerdegen
2016-01-20 14:11 ` Stefan Monnier
2016-01-20 17:37 ` Michael Heerdegen
2016-01-20 22:08 ` Stefan Monnier
2016-01-21 17:44 ` Michael Heerdegen
2016-01-21 18:00 ` Eli Zaretskii
2016-01-21 18:26 ` Eli Zaretskii
2016-01-21 18:41 ` Michael Heerdegen
2016-01-22 0:56 ` John Wiegley
2016-01-22 7:07 ` Eli Zaretskii
2016-01-22 7:39 ` John Wiegley
2016-01-22 12:01 ` Michael Heerdegen
2016-01-22 17:50 ` John Wiegley
2016-01-22 19:07 ` Michael Heerdegen
2016-01-22 19:15 ` Michael Heerdegen
2016-01-22 19:52 ` John Wiegley
2016-03-07 14:38 ` John Wiegley
2016-03-08 5:04 ` Stefan Monnier
2016-03-08 17:17 ` John Wiegley
2016-01-22 20:07 ` Richard Stallman
2016-01-22 11:58 ` Michael Heerdegen
2016-01-19 20:17 ` Drew Adams
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=87egddid6s.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.