=> result*
property-entry ::= property-name | (variable-name porperty-name)Arguments and Values:
property-name — a property name; not evaluated.
variable-name — a variable name; not evaluated.
object-form — a form; evaluated to produce object.
object — an object.
declaration — a declare expression; not evaluated.
forms — an implicit progn.
results — the values returned by the forms.
Description:
WITH-PROPERTIESestablishes a lexical environment for referring to the properties in object named by the given property-names as though they were lexically bound variables.Within this context the value of each property can be specified by using its name, or the corresponding variable-name, if one was passed for that property. Both
setfandsetqcan be used to set the value of the property.
WITH-PROPERTIEStranslates an appearance of property-name or variable-name as a variable into a call toPROPERTY-VALUE.Examples: None
Exceptional Situations:
The consequences are undefined if any property is not present in object.
Notes:
A
WITH-PROPERTIESexpression of the form:(with-properties (property-entry1 ... property-entryn) instance-form form1 ... formk)expands into the equivalent of
(let ((in instance-form)) (symbol-macrolet (Q1 ... Qn) form1 ... formk))where
Qiis(property-entryi () (property-value in 'property-entry))if
property-entryiis a symbol, and is(variable-namei () (property-value in 'property-namei))if
property-entryiis of the form(variable-namei 'property-namei)Also, note that the standard macro
WITH-ACCESSORSworks on objects too.