(mixin ..forms) forms: zero or more forms
C
Applies mixins to a class definition.
When the class
clause is evaluated, each of the forms
are evaluated in order,
from left to right. They must each return a class which was previously defined using the
mixin
macro. The definitions of those classes are "mixed into" the new
class which is being defined.
This means that:
- Any states defined by the mixins are effectively copied-and-pasted at the beginning of the class definition. Name collisions between states are forbidden.
- Any fields, constants, methods and
properties, including wrappers, are copied into the toplevel of the
class definition. Their fully-qualified name is
MixinName:item
, rather than the usualMain:item
. Name collisions are forbidden; mixins do not participate in shadowing. - The mixin's
init-mixin
clause, if any, will act as a wrapper method for the class'init
method. - The mixin's
fini-mixin
clause, if any, will be invoked after the class'fini
method.