3.4 Property List Functions

With each id in the system is a “property list”, a set of entities which are associated with the id for fast access. These entities are called “flags” if their use gives the id a single valued property, and “properties” if the id is to have a multivalued attribute: an indicator with a property.

Flags and indicators may clash, consequently care should be taken to avoid this occurrence. Flagging X with an id which already is an indicator for X may result in that indicator and associated property being lost. Likewise, adding an indicator which is the same id as a flag may result in the flag being destroyed.

FLAG(U:id-list, V:id):NIL eval, spread
 
U is a list of ids which are flagged with V. The effect of FLAG is that FLAGP will have the value T for those ids of U which were flagged. Both V and all the elements of U must be identifiers or the type mismatch error occurs.

FLAGP(U:any, V:any):boolean eval, spread
 
Returns T if U has been previously flagged with V, else NIL. Returns NIL if either U or V is not an id.

GET(U:any, IND:any):any eval, spread
 
Returns the property associated with indicator IND from the property list of U. If U does not have indicator IND, NIL is returned. GET cannot be used to access functions (use GETD instead).

PUT(U:id, IND:id, PROP:any):any eval, spread
 
The indicator IND with the property PROP is placed on the property list of the id U. If the action of PUT occurs, the value of PROP is returned. If either of U and IND are not ids the type mismatch error will occur and no property will be placed. PUT cannot be used to define functions (use PUTD instead).

REMFLAG(U:any-list, V:id):NIL eval, spread
 
Removes the flag V from the property list of each member of the list U. Both V and all the elements of U must be ids or the type mismatch error will occur.

REMPROP(U:any, IND:any):any eval, spread
 
Removes the property with indicator IND from the property list of U. Returns the removed property or NIL if there was no such indicator.