On Wednesday 30 April 2008 08:56:24 Ovid wrote: > > That was always my goal for roles in the first place. I'll be a > > little sad if Perl 6 requires an explicit notation to behave correctly > > here -- that is, if the default check is for subtyping, not polymorphic > > equivalence.
> I had initially thought this, but think about the case where someone > wants to rewrite something to be compliant to another interface. If I > pass a CGI::Simple object to a method expecting a CGI object, there's > an excellent chance that it will *just work*, even though there's no > relation between the two. Sure; ad hoc polymorphism allows for cognates. Not all cognates are false cognates. (If no cognates were false, duck typing would work in a correctness sense. Sadly, both trees and dogs bark.) > In this case, a role really doesn't work. I think that's a non sequitur. There's no allomorphism in your example. This is why roles-as-types is so important: type inferencers can't infer allomorphism because allomorphism relies on explicitly-marked semantic meanings. -- c