role Metamodel::RoleContainer {}
Implements the ability to hold roles to be held for composition.
class A does SomeRole {}
roughly corresponds to
class A {
BEGIN A.^add_role(SomeRole);
}
method add_role(Metamodel::RoleContainer:D: $obj, Mu $role)
Adds the $role
to the list of roles to be composed.
method roles_to_compose(Metamodel::RoleContainer:D: $obj --> List:D)
returns a list of roles added with add_role
, which are to be composed at type composition time.