syntax is
1 | language documentation Type system |
1.1 | (Type system) classes is is |
Documentation for syntax is
assembled from the following types:
language documentation Type system
From Type system
(Type system) classes is is
Defined as:
multi sub trait_mod:<is>(Mu , Mu )
The trait is
accepts a type object to be added as a parent class of a class in its definition. To allow multiple inheritance the trait can be applied more than once. Adding parents to a class will import their methods into the target class. If the same method name occurs in multiple parents, the first added parent will win.
If no is
trait is provided the default of Any
will be used as a parent class. This forces all Raku objects to have the same set of basic methods to provide an interface for introspection and coercion to basic types.
say A.new.^parents(:all).perl;# OUTPUT: «(Any, Mu)»is A is Bsay C.new.from-a();# OUTPUT: «A::from-a»