all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* plist-put modification by side effect
@ 2009-01-31 21:06 Dan Davison
  2009-01-31 23:02 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Davison @ 2009-01-31 21:06 UTC (permalink / raw)
  To: help-gnu-emacs mailing list

,----[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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-02-02 18:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.6361.1233436001.26697.help-gnu-emacs@gnu.org>
2009-01-31 22:46 ` plist-put modification by side effect Helmut Eller
2009-01-31 21:06 Dan Davison
2009-01-31 23:02 ` 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

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.