defobject name ({super}*) ({slot}*)
{option}*
|
[Macro] |
Defines a new class of object. name is the name for
the new class. Following name comes a list of zero or more
superclasses. The new object will inherit slots and behavior from each
super in the list. Following this list comes
the slot specification list. Each slot in the list is either
the name of a slot or a list of the form:
(slot &key :initform :accessor :reader :writer)
Following the slot specification list comes zero or more options.
Each option is a list of the form:
(option {value}*)
Where option is the keyword option name and value is a
value.
defobject supports the following options:
- (:parameters {slot}* {&optional {slot}*}* {&key {slot}*}* {&rest slot}*
)
- Declares each slot to be a parameter of the object. A
parameter is a slot whose value contributes to the makeup of a
musical event. The order of slots in the parameter list defines
the order in which they are examined during event processing. Unqualfied
parameters are considered to be required, which means that an error
is signaled if a slot value is not present when the output event is
processed. Three additional types of parameters are supported depending
on the type of object being defined: optional, keyword and rest. These
parameters are marked by preceding the affected slot(s) in the parameter list with
&optional, &key, or &rest.
Optional parameters are not processed if unbound,
keyword parameters are optional but the slot value is preceded
by a "keyword" appropriate to the slot name and type of event
being processed. A single rest parameter holds a list
of values that are then "spread" over a number of parameters positions in
the output event.
defobject is a wrapper for Lisp's defclass macro.
It automatically defines keyword and non-keyword slot initialization
arguments to be used in conjunction with macros like
algorithm and object.
See Also:
i1.lisp
Last Modified: 5-Mar-1998