develooper Front page | perl.perl6.language | Postings from April 2008

method hiding (or not) in derived classes

Thread Next
From:
John M. Dlugosz
Date:
April 19, 2008 01:00
Subject:
method hiding (or not) in derived classes
Perl 6 has a concept of a "candidate list".  The candidate list are those that could handle the call, typically inherited methods and multi variations.  

It seems that multi variations, at least with respect to the semicolon parameters, compare the actual type and drop out of the list if any don't match.

What about ordinary methods (and ordinary parameters of multis)?  Does the candidate list hold every method name that matches, or does it do simpler parameter matching based on number of arguments, required named arguments, etc.?

If that is the case, then a derived method might not hide a base class method if the parameter list is seriously incompatible.  More interestingly, left-to-right ordering of multiply-inherited base classes will be checked for applicability rather than  arbitrarily taking the leftmost.

--John

Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About