Rules / Types, classes & roles / metamodel

Metamodel::PackageHOW Reference

Metaobject representing a Raku package.

What it is #

Routines #

Signatures are reproduced from the documentation, including their declared return types. A routine listed here is part of the type's published interface; whether Raku++ implements it is a separate question, answered by the examples below.

method archetypes #

method archetypes()

Returns the archetypes for this model, that is, the properties a metatype can implement.

method new #

method new(*%named)

Creates a new PackageHOW.

method new_type #

method new_type(:$name = '<anon>', :$repr, :$ver, :$auth)

Creates a new package, with optional representation, version and auth field.

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.

3 no-output · 1 rakupp-differs

class Metamodel::PackageHOW
  does Metamodel::Naming
  does Metamodel::Documenting
  does Metamodel::Stashing
  does Metamodel::TypePretense
  does Metamodel::MethodDelegation { }

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

package P {};
say P.HOW; # OUTPUT: «Perl6::Metamodel::PackageHOW.new␤»
Documentation
Perl6::Metamodel::PackageHOW.new
Rakudo
Perl6::Metamodel::PackageHOW.new
Raku++
(Metamodel::ClassHOW)

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

method compose($obj, :$compiler_services)

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

method is_composed($obj)

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