After an instance of a class has been created, it must be initialized with values for the instance variables. Initialization starts with the variables defined by the instance's most specific class. During this initialization process, special procedures (e.g., super-init) are invoked to initialize instance variables defined in the superclasses.
The make-object procedure creates instances of a class. This procedure takes a class and a number of initialization arguments that are assigned to initialization variables when the object is created. Also, arguments passed to a superclass initialization procedure are assigned to initialization variables defined in the superclass. The initialization variables can be used in the initial value expressions of instance variables. Object creation is described in more detail in section 2.13.3.
initialization-variables has one of these forms:
variable
(variable
where variable is an identifier and variable-with-default has
the form:
variable-with-default
)
(variable
variable-with-default
. variable)
(variable default-value-expression)
In the first form, all initialization arguments are put into a list and variable is bound to the list. In the second form, each variable is bound to an individual initialization argument. In the last form, initialization arguments are assigned to variables preceding the dot; extra initialization arguments are put into a list that is assigned to the variable after the dot.
If an initialization argument is not provided for a variable that has a default-value-expression, then the expression is evaluated to obtain a value for the variable. A default-value-expression is only evaluated when an argument is not provided for its variable. The environment of the default-value-expression includes all of the initialization variables and all of the instance variables (which have not yet been initialized). If multiple default-value-expressions are evaluated, they are evaluated in the order of definition.