class Metamodel::PackageHOW
Metaobject representing a Raku package.
does Metamodel::Namingdoes Metamodel::Documentingdoes Metamodel::Stashingdoes Metamodel::TypePretensedoes Metamodel::MethodDelegation
Warning: this class is part of the Rakudo implementation, and is not a part of the language specification.
Metamodel::PackageHOW
is the metaclass behind the package
keyword.
;say P.HOW; # OUTPUT: «Perl6::Metamodel::PackageHOW.new»
Methods
method archetypes
Defined as:
method archetypes()
Returns the archetypes for this model, that is, the properties a metatype can implement.
method new
Defined as:
method new(*)
Creates a new PackageHOW
.
method new_type
Defined as:
method new_type(: = '<anon>', :, :, :)
Creates a new package, with optional representation, version and auth field.
compose
Defined as:
method compose(, :)
Sets the metapackage as composed.
is_composed
Defined as:
method is_composed()
Returns the composed status of the metapackage.
Type Graph
Routines supplied by role Metamodel::Naming
Metamodel::PackageHOW does role Metamodel::Naming, which provides the following routines:
(Metamodel::Naming) method name
method name()
Returns the name of the metaobject, if any.
say 42.^name; # OUTPUT: «Int»
(Metamodel::Naming) method set_name
method set_name(, )
Sets the new name of the metaobject.
Routines supplied by role Metamodel::Documenting
Metamodel::PackageHOW does role Metamodel::Documenting, which provides the following routines:
(Metamodel::Documenting) method set_why
method set_why()
Sets the documentation for a type to $why
.
(Metamodel::Documenting) method WHY
method WHY()
Returns the documentation for a type.
Routines supplied by role Metamodel::Stashing
Metamodel::PackageHOW does role Metamodel::Stashing, which provides the following routines:
(Metamodel::Stashing) method add_stash
method add_stash()
Creates and sets a stash for a type, returning $type_obj
.
This method is typically called as the last step of creating a new type. For example, this is how it would be used in a minimal HOW that only supports naming and stashing:
does Metamodel::Namingdoes Metamodel::Stashingmy Mu constant WithStash = WithStashHOW.new_type: :name<WithStash>;say WithStash.WHO; # OUTPUT: «WithStash»