6.5 Mixins (original) (raw)

6.5 Mixins🔗

(mixin (interface-expr ...) (interface-expr ...)
class-clause ...)

Produces a mixin, which is a procedure that encapsulates a class extension, leaving the superclass unspecified. Each time that a mixin is applied to a specific superclass, it produces a new derived class using the encapsulated extension.

The given class must implement interfaces produced by the first set ofinterface-exprs. The result of the procedure is a subclass of the given class that implements the interfaces produced by the second set of interface-exprs. The class-clauses are as for class*, to define the class extension encapsulated by the mixin.

Evaluation of a mixin form checks that theclass-clauses are consistent with both sets ofinterface-exprs.