[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
plist-put modification by side effect
From: |
Dan Davison |
Subject: |
plist-put modification by side effect |
Date: |
Sat, 31 Jan 2009 16:06:30 -0500 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
,----[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
- plist-put modification by side effect,
Dan Davison <=