![]() |
VOOZH | about |
In Lisp, every symbol has a property list (plist). When a symbol is created initially its property list is empty. A property list consists of entries where every entry consists of a key called an indicator and a value called a property . There are no duplicates among the indicators. In contrast to association lists the operations for adding and removing plist entries alter the plist rather than creating a new one.
Function | Syntax | Usage |
|---|---|---|
| get function | get symbol indicator &optional default | get searched the plist for an indicator equivalent to indicator. If the found value is returned or else the default is returned. If the default is not specified nil is returned. |
| setf function | setf((get function) property/value) | setf is used with getting to create a new property value pair. |
| symbol-plist | (symbol-plist symbol) | symbol-plist allows you to see all the properties of a symbol |
| remprop | remprop symbol indicator | remprop function is used to remove the property equivalent to the indicator. |
| getf | getf place indicator &optional default | getf searches the property list stored in place for an indicator equivalent to an indicator. If one is found, then the corresponding value is returned; otherwise, the default is returned. If the default is not specified, then nil is used for default. |
| remf | remf place indicator | remf removes the property equivalent to the given indicator from the given place. |
Example:
Output:
(FAV-BOOK HARRYPOTTER OCCUPATION DOCTOR AGE 20) (OCCUPATION DOCTOR AGE 20) T NIL