Previous: , Up: Symbol Properties   [Contents][Index]


13.4.3 Property Lists Not Associated with Objects

These functions are useful for manipulating property lists that are stored in places other than symbols:

Function: getf plist property &optional default

This returns the value of the property property stored in the property list plist. For example,

(getf '(foo 4) 'foo)
     ⇒ 4
Macro: putf plist property value

This stores value as the value of the property property in the property list plist. It may modify plist destructively, or it may construct a new list structure without altering the old. The function returns the modified property list, so you can store that back in the place where you got plist. For example,

(setq my-plist '(bar t foo 4))
     ⇒ (bar t foo 4)
(setq my-plist (putf my-plist 'foo 69))
     ⇒ (bar t foo 69)
(setq my-plist (putf my-plist 'quux '(a)))
     ⇒ (quux (a) bar t foo 5)
Function: plists-eq a b

This function returns non-nil if property lists a and b are eq. This means that the property lists have the same values for all the same properties, where comparison between values is done using eq.

Function: plists-equal a b

This function returns non-nil if property lists a and b are equal.

Both of the above functions do order-insensitive comparisons.

(plists-eq '(a 1 b 2 c nil) '(b 2 a 1))
     ⇒ t
(plists-eq '(foo "hello" bar "goodbye") '(bar "goodbye" foo "hello"))
     ⇒ nil
(plists-equal '(foo "hello" bar "goodbye") '(bar "goodbye" foo "hello"))
     ⇒ t

Previous: , Up: Symbol Properties   [Contents][Index]