SPVM::Cloneable − Interface Type to Clone Object
The Cloneable interface in SPVM represents a cloneable interface.
class Point {
interface Cloneable;
method clone : Point () {
my $new_point = Point−>new($self−>x,
$self−>y);
return $new_point;
}
}
"required method clone : object ();"
The implementation must return the cloned object.
Copyright (c) 2023 Yuki Kimoto
MIT License