SPVM::Point - Point
use Point; my $point = Point->new; my $point = Point->new(1, 2); $point->set_x(1); $point->set_y(2); my $x = $point->x; my $y = $point->y; my $point_string = $point->to_string;
Point is a class for a point.
Point
Point class has the following interfaces.
Stringable
Cloneable
has x : rw int;
x.
x
has y : rw int;
y.
y
static method new : Point ($x = 0 : int, $y = 0 : int)
Create a new Point object with "x" and "y".
method new_xy : Point ($x : int, $y : int)
The alias for the following code using "new"
my $point = Point->new($x, $y);
This method is deprecated and will be removed after 2022-09-03.
method clear : void ()
Set "x" and "y" to 0.
0
method cloneable_clone : object ()
Create a new Point object that clones myself.
method to_string : string ();
Stringify the Point object as the following format.
(1,2)
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.