role Metamodel::MROBasedMethodDispatch { }

Warning: this role is part of the Rakudo implementation, and is not a part of the language specification.

This role implements locating methods based on the method resolution order of related (usually "super"/"parent") types.

Methods §

method find_method §

method find_method($obj$name:$no_fallback*%adverbs)

Given a method name, it returns the method object of that name which is closest in the method resolution order (MRO). If no method can be found, it returns a VM-specific sentinel value (typically a low-level NULL value) that can be tested for with a test for definedness:

for <upper-case  uc> {
    Str.^find_method: $^meth andthen .("foo").say
        orelse "method `$meth` not found".say
}
# OUTPUT: 
# method `upper-case` not found 
# FOO 

If :no_fallback is supplied, fallback methods are not considered.

method find_method_qualified §

method find_method_qualified($obj$type$name)

Given a method name and a type, returns the method from that type. This is used in calls like

self.SomeParentClass::the_method();

method can §

method can($obj$name)

Returns the list of methods of that name the object can do.

method publish_method_cache §

Defined as:

method publish_method_cache($obj)

Walk MRO and add methods to cache, unless another method lower in the class hierarchy "shadowed" it.

Type Graph §

Type relations for Metamodel::MROBasedMethodDispatch
perl6-type-graph Metamodel::MROBasedMethodDispatch Metamodel::MROBasedMethodDispatch Mu Mu Any Any Any->Mu Metamodel::Naming Metamodel::Naming Metamodel::Documenting Metamodel::Documenting Metamodel::Versioning Metamodel::Versioning Metamodel::Stashing Metamodel::Stashing Metamodel::AttributeContainer Metamodel::AttributeContainer Metamodel::Finalization Metamodel::Finalization Metamodel::MethodContainer Metamodel::MethodContainer Metamodel::PrivateMethodContainer Metamodel::PrivateMethodContainer Metamodel::MultiMethodContainer Metamodel::MultiMethodContainer Metamodel::RoleContainer Metamodel::RoleContainer Metamodel::MultipleInheritance Metamodel::MultipleInheritance Metamodel::DefaultParent Metamodel::DefaultParent Metamodel::C3MRO Metamodel::C3MRO Metamodel::MROBasedTypeChecking Metamodel::MROBasedTypeChecking Metamodel::Trusting Metamodel::Trusting Metamodel::BUILDPLAN Metamodel::BUILDPLAN Metamodel::Mixins Metamodel::Mixins Metamodel::BoolificationProtocol Metamodel::BoolificationProtocol Metamodel::ClassHOW Metamodel::ClassHOW Metamodel::ClassHOW->Metamodel::MROBasedMethodDispatch Metamodel::ClassHOW->Any Metamodel::ClassHOW->Metamodel::Naming Metamodel::ClassHOW->Metamodel::Documenting Metamodel::ClassHOW->Metamodel::Versioning Metamodel::ClassHOW->Metamodel::Stashing Metamodel::ClassHOW->Metamodel::AttributeContainer Metamodel::ClassHOW->Metamodel::Finalization Metamodel::ClassHOW->Metamodel::MethodContainer Metamodel::ClassHOW->Metamodel::PrivateMethodContainer Metamodel::ClassHOW->Metamodel::MultiMethodContainer Metamodel::ClassHOW->Metamodel::RoleContainer Metamodel::ClassHOW->Metamodel::MultipleInheritance Metamodel::ClassHOW->Metamodel::DefaultParent Metamodel::ClassHOW->Metamodel::C3MRO Metamodel::ClassHOW->Metamodel::MROBasedTypeChecking Metamodel::ClassHOW->Metamodel::Trusting Metamodel::ClassHOW->Metamodel::BUILDPLAN Metamodel::ClassHOW->Metamodel::Mixins Metamodel::ClassHOW->Metamodel::BoolificationProtocol Metamodel::NativeHOW Metamodel::NativeHOW Metamodel::NativeHOW->Metamodel::MROBasedMethodDispatch Metamodel::NativeHOW->Any Metamodel::NativeHOW->Metamodel::Naming Metamodel::NativeHOW->Metamodel::Documenting Metamodel::NativeHOW->Metamodel::Versioning Metamodel::NativeHOW->Metamodel::Stashing Metamodel::NativeHOW->Metamodel::MultipleInheritance Metamodel::NativeHOW->Metamodel::C3MRO Metamodel::NativeHOW->Metamodel::MROBasedTypeChecking Metamodel::BaseType Metamodel::BaseType Metamodel::EnumHOW Metamodel::EnumHOW Metamodel::EnumHOW->Metamodel::MROBasedMethodDispatch Metamodel::EnumHOW->Any Metamodel::EnumHOW->Metamodel::Naming Metamodel::EnumHOW->Metamodel::Stashing Metamodel::EnumHOW->Metamodel::AttributeContainer Metamodel::EnumHOW->Metamodel::MethodContainer Metamodel::EnumHOW->Metamodel::MultiMethodContainer Metamodel::EnumHOW->Metamodel::RoleContainer Metamodel::EnumHOW->Metamodel::MROBasedTypeChecking Metamodel::EnumHOW->Metamodel::BUILDPLAN Metamodel::EnumHOW->Metamodel::Mixins Metamodel::EnumHOW->Metamodel::BoolificationProtocol Metamodel::EnumHOW->Metamodel::BaseType

Expand above chart

Generated from