in reply to Re: Interfaces for the masses! in thread Interfaces for the masses!
traits/roles are going to be a boon. In a way, though, by saying that some class does some role you are entering into a contract not completely dissimilar to interfaces, right? (That is, if I understand what I've read of the Apocalypses and Synopses correctly.)
Re^3: Interfaces for the masses!
by chromatic (Archbishop) on Mar 24, 2006 at 07:37 UTC
|
An interface (as you describe it, similar to the Java concept) is a degenerate case of a role. A role can provide default (and even parametrized) implementations of the appropriate methods and can disambiguate dispatch at compile time.
Hopefully, Perl 6 will even also be able to dispatch multimethods based on roles.
| [reply] [Watch: Dir/Any] |
|