From: Harald Hanche-Olsen <hanche@math.ntnu.no>
To: emacs-devel@gnu.org
Subject: Re: (setq x (plist-put x :new 'value))
Date: Fri, 21 Aug 2009 18:49:04 -0400 (EDT) [thread overview]
Message-ID: <20090821.184904.79662116.hanche@math.ntnu.no> (raw)
In-Reply-To: <87hbw0es6e.fsf@x2.delysid.org>
+ Mario Lang <mlang@delysid.org>:
> The docstring of plist-put reads:
>
> ---<snip>---
> [...]
> otherwise the new PROP VAL pair is added. The new plist is returned;
> use `(setq x (plist-put x prop val))' to be sure to use the new value.
> The PLIST is modified by side effects.
> ---<snip>---
>
> The last two lines seem like they are contradicting each other.
> In fact, what plist-put really does if it has to add a new item is
> setcdr on the last cons in the list. I kind of feel the second last line
> in the docstring should be removed, since (setq x (plist-put x prop val))
> is not necessary. Or am I missing something?
Yes: the plist could be empty in the first place.
(setq plist nil)
(plist-put plist :foo :bar) ; => (:foo :bar)
plist ; => nil
- Harald
prev parent reply other threads:[~2009-08-21 22:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-21 22:08 (setq x (plist-put x :new 'value)) Mario Lang
2009-08-21 22:49 ` Harald Hanche-Olsen [this message]
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=20090821.184904.79662116.hanche@math.ntnu.no \
--to=hanche@math.ntnu.no \
--cc=emacs-devel@gnu.org \
/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.