unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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
[parent not found: <mailman.6361.1233436001.26697.help-gnu-emacs@gnu.org>]

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 --
2009-01-31 21:06 plist-put modification by side effect 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
     [not found] <mailman.6361.1233436001.26697.help-gnu-emacs@gnu.org>
2009-01-31 22:46 ` Helmut Eller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).