Addproperty Command Example

Details

Action

Adds an item to the property list of an object.

Addproperty Prop to Proptype of target

or

Addproperty Prop Proptype target

has the effect of
adjoining to the 'proptype' property of target the item Prop. Target is the name of an object. The 'proptype' property must either be a list, or be undefined. If a proptype is undefined, its value is returned as the empty list. If the property Prop was already in the list, it is not added again.

Make variable John

Make variable tennis

Make variable chess

Make variable hobbies

Addproperty tennis to hobbies of John

Addproperty chess to hobbies of John

The first addproperty statement creates a hobbies property for John. The value of that property is list(tennis). The second statement adjoins chess to the list, so that the hobbies property of John is now: list(chess, tennis).

A later call: Addproperty tennis to hobbies of John has no effect on the hobbies property of John because tennis is already in the list of hobbies.