all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: help-gnu-emacs mailing list <help-gnu-emacs@gnu.org>
Subject: plist-put modification by side effect
Date: Sat, 31 Jan 2009 16:06:30 -0500	[thread overview]
Message-ID: <20090131210630.GC17573@stats.ox.ac.uk> (raw)

,----[C-h f plist-put]
| plist-put is a built-in function in `C source code'.
| (plist-put plist prop val)
| 
| Change value in plist of prop to val.
| plist is a property list, which is a list of the form
| (PROP1 VALUE1 PROP2 VALUE2 ...).  prop is a symbol and val is any object.
| If prop is already a property on the list, its value is set to val,
| 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.
| 
`----

I don't get this. It says the plist is altered by side effects. So
what's with the "but just to be extra careful use (setq ...)"  advice?
I think I've seen a similar statemenmt in other docstrings, but I
can't remember which. Is there some subtlety that means you can't
actually rely on the side effect? Surely not?

Thanks,

Dan


-- 
http://www.stats.ox.ac.uk/~davison




             reply	other threads:[~2009-01-31 21:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-31 21:06 Dan Davison [this message]
2009-01-31 23:02 ` plist-put modification by side effect Thien-Thi Nguyen
2009-02-01 16:23   ` Dan Davison
     [not found]     ` <mailman.6441.1233508294.26697.help-gnu-emacs@gnu.org>
2009-02-01 18:22       ` Barry Margolin
2009-02-02  9:55     ` Thien-Thi Nguyen
     [not found]     ` <mailman.6500.1233568748.26697.help-gnu-emacs@gnu.org>
2009-02-02 18:07       ` Andreas Politz
     [not found] <mailman.6361.1233436001.26697.help-gnu-emacs@gnu.org>
2009-01-31 22:46 ` Helmut Eller

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=20090131210630.GC17573@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=help-gnu-emacs@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.