develooper Front page | perl.perl6.language | Postings from January 2004

Re: Roles and Mix-ins?

Thread Previous | Thread Next
Jonathan Lang
January 5, 2004 13:06
Re: Roles and Mix-ins?
Message ID:
David Storrs wrote:
> On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote:
> > On Sat, Dec 13, 2003 at 04:57:17AM -0700, Luke Palmer wrote:
> > : For one, one role's methods don't silently override another's. 
> > : Instead, you get, er, role conflict and you have to disambiguate 
> > : yourself.  
> How do you disambiguate?

For most cases, you either alias or exclude one or the other of the
offending methods from the final class, rendering the ambiguity moot. 
However, role conflict not disambiguiated in either of the above manners
throws an exception (presumably with a list of the ambiguous methods),
letting you write code to disambiguate in whatever manner you like on a
case-by-case basis.  The only question I have about such an exception is
what sort of information your ambiguity handler code receives.  

Jonathan "Dataweaver" Lang

Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About