BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2021-01-08

role Metamodel::RoleContainer

Metaobject that supports holding/containing roles

role Metamodel::RoleContainer {}
Code

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

Implements the ability to hold roles to be held for composition.

class A does SomeRole {}
Code

roughly corresponds to

class A {
    BEGIN A.^add_role(SomeRole);
}
Code

Methods§

method add_role§

method add_role($obj, Mu $role)
Code

Adds the $role to the list of roles to be composed.

method roles_to_compose§

method roles_to_compose($obj --> List:D)
Code

returns a list of roles added with add_role, which are to be composed at type composition time.