Online Manual: Mixer-related Expressions
Given a classage, its mixers are matched when the classage is used to form a compound. In this sense, the enclosing classage of the mixers does not internally control how mixers are used. Therefore, there is no analogous expression such as plugin or connect as in the plugger or connector cases.
A classage itself does control how a method inside a mixer can be invoked. It has two forms:
- the A::m(e1,...,en) expression (or called the mixer invocation expression). At runtime, it invokes a method m (either an import or an export) belonging to the mixer A. Since the typechecking of the create expression ensures when an objectage is created, all its dangling imports in the mixers must have been satisfied, Such an invocation can always lead to the execution of some code without runtime exception.
- the m(e1, ..., en) expression (or called the passive mixer invocation expression). This expression can only be used within the scope of a mixer (defined inside the export of a plugger). At runtime, it invokes a method m (either an import or an export) belonging to the enclosing mixer.
This example demonstrates the use of these expressions in the context of overriding.
Typechecking
Typechecking these two kinds of expressions are almost identical to the cases where singleton plugger invocation expression and passive plugger invocation are typechecked, which we do not repeat here.
Just as for plugger-related expressions, these two invocations deserve attention when when method m is both an export and an import in the mixer (the overriding case with default implementation). If the import and the export have different signatures (the export one being more specialized according to the well-formedness of classages), the signature applied for typechecking the invocations should be the import one to ensure type soundness.
An example including most of the illegal cases of mixer invocations is here.