Rules / Types, classes & roles / metamodel

Metamodel::ParametricRoleHOW Reference

Represents a non-instantiated, parameterized, role.

What it is #

role group, which will need to be defined in advance.

Examples, run three ways #

Every example below comes from the official documentation, together with the output that documentation asserts. Each was then executed by Rakudo and by Raku++ when this page was built. Where the three agree, one result is shown; where they do not, all three are — because which of them is wrong is exactly the information worth having.

1 no-output · 2 rakupp-differs

class Metamodel::ParametricRoleHOW
does Metamodel::Naming
does Metamodel::Documenting
does Metamodel::Versioning
does Metamodel::MethodContainer
does Metamodel::PrivateMethodContainer
does Metamodel::MultiMethodContainer
does Metamodel::AttributeContainer
does Metamodel::RoleContainer
does Metamodel::MultipleInheritance
does Metamodel::Stashing
does Metamodel::TypePretense
does Metamodel::RolePunning
does Metamodel::ArrayType {}

Not executed: the documentation states no expected output for this example.

(role Zape[::T] {}).HOW.say;# OUTPUT: «Perl6::Metamodel::ParametricRoleHOW.new␤»
(role Zape {}).HOW.say; # OUTPUT: «Perl6::Metamodel::ParametricRoleHOW.new␤»
Documentation
Perl6::Metamodel::ParametricRoleHOW.new
Perl6::Metamodel::ParametricRoleHOW.new
Rakudo
Perl6::Metamodel::ParametricRoleHOW.new
Perl6::Metamodel::ParametricRoleHOW.new
Raku++

Raku++ disagrees with both the documentation and Rakudo — a defect.

my \zipi := Metamodel::ParametricRoleHOW.new_type( name => "zape", group => "Zape");
say zipi.HOW; # OUTPUT: «Perl6::Metamodel::ParametricRoleHOW.new␤»
Documentation
Perl6::Metamodel::ParametricRoleHOW.new
Rakudo
Perl6::Metamodel::ParametricRoleHOW.new
Raku++
(Metamodel::ClassHOW)

Raku++ disagrees with both the documentation and Rakudo — a defect.