develooper Front page | perl.perl6.language | Postings from October 2005

Re: Role Method Conflicts and Disambiguation

Thread Previous | Thread Next
From:
Jonathan Scott Duff
Date:
October 28, 2005 11:54
Subject:
Re: Role Method Conflicts and Disambiguation
Message ID:
20051028185450.GE29296@pobox.com
On Fri, Oct 28, 2005 at 02:29:36PM -0400, Stevan Little wrote:
> I should be allowed to create a role with all sorts of conflicts which
> I leave for the classes to deal with.

Er, why? I've read this sentence several times and I'm really having
trouble grasping why anyone would deliberately create a conflicted role
and want to postpone the conflict resolution until later. It seems to me
that conflicts should be resolved sooner rather than later. Especially
in the light of run-time composition:

role A { method foo { ... } ... }
role B { method foo { ... } ... }
role C does B does A { ... }
my Dog $spot; 
...
$spot does C;

Would you rather wait until perl is actually executing that last line
of code before finding out there's a conflict or would you rather know
there's a conflict at compile-time (when C is immediately composed of
A and B)?

Yes, I realize that Perl6 already has the "problem" that run-time
composition could cause conflicts, but I want to have a slightly
smaller chance of running into it :)

-Scott
-- 
Jonathan Scott Duff
duff@pobox.com

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About