4 ms·
How are roles different from mixins? The only difference that I can think of is that mixins are declared at class declaration, is that what you mean?
by tomp 15y ago
How are roles different from mixins?
The only difference that I can think of is that mixins are declared at class declaration, is that what you mean?
- chromatic 15y agoRoles have specific composition rules which forbid name collisions; there's no last-in wins rule. Roles also provide type allomorphism which is much less ambiguous than duck typing.