Metaobjects that support versioning
Warning: this role is part of the Rakudo implementation, and is not a part of the language specification.
Metamodel role for (optionally) versioning metaobjects.
When you declare a type, you can pass it a version, author, and/or API and get them, like so:
:ver<0.0.1>:auth<github:Kaiepi>:api<1>say Versioned.^ver; # OUTPUT: «v0.0.1»say Versioned.^auth; # OUTPUT: «github:Kaiepi»say Versioned.^api; # OUTPUT: «1»
This is roughly equivalent to the following, which also sets them explicitly:
BEGINsay Versioned.^ver; # OUTPUT: «v0.0.1»say Versioned.^auth; # OUTPUT: «github:Kaiepi»say Versioned.^api; # OUTPUT: «1»
method ver()
Returns the version of the metaobject, if any, otherwise returns Mu.
method auth()
Returns the author of the metaobject, if any, otherwise returns an empty string.
method api()
Returns the API of the metaobject, if any, otherwise returns an empty string.
method set_ver(, )
Sets the version of the metaobject.
method set_auth(, )
Sets the author of the metaobject.
method set_api(, )
Sets the API of the metaobject.