Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add find_method fallback dispatcher for when there's no hit from the …
…cache; can flesh out more bits in here later for e.g. weird delegation cases.
  • Loading branch information
jnthn committed May 30, 2011
1 parent 8511092 commit c704aff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Perl6/Metamodel/ClassHOW.pm
Expand Up @@ -45,6 +45,18 @@ class Perl6::Metamodel::ClassHOW

$obj
}

# Whle we normally end up locating methods through the method cache,

This comment has been minimized.

Copy link
@tadzik

tadzik May 30, 2011

I assume you mean "while" :)

# this is here as a fallback.
method find_method($obj, $name) {
for self.mro($obj) {
my %methods := $_.HOW.method_table($_);
if pir::exists(%methods, $name) {
return %methods{$name}
}
}
pir::null__P();
}

method publish_method_cache($obj) {
# Walk MRO and add methods to cache, unless another method
Expand Down

0 comments on commit c704aff

Please sign in to comment.