package RakuAST::ComplexLiteral
class RakuAST::ComplexLiteral { }
The RakuAST::ComplexLiteral class represents a complex number (such as
`42+i`).
Object introspection
RakuAST::ComplexLiteral objects are typically created when parsing
Raku Programming Language code. So most developers will only need to
know how to introspect the objects created.
These introspection methods are available (in alphabetical order):
value
say $literal.value;
The value method returns the value it is representing.
Object creation
There is one way to create a RakuAST::ComplexLiteral object directly
(rather than having RakuAST::Literal.from-value figure it out):
new
my $literal = RakuAST::ComplexLiteral.new(42+i);
say $literal.^name; # RakuAST::ComplexLiteral
Creates a RakuAST::ComplexLiteral object from the given value.
Assumes the value is really a Complex, does not do any sanity
checks.