Name
SPVM::Cloner - Interface Type for the Callback to Clone a Object
Usage
Description
Cloner is the interface type for the callback to clone an object.
Interface Methodss
required method : object ($object : object);
The implementation must receive an object and return the cloned object.
Class Methods
static method default_cloner : Cloner ();
Returns a default cloner.
The implementation of the default cloner is
method : object (
$object
: Cloneable) {
my
$clone
= (object)
undef
;
if
(
$object
) {
$clone
=
$object
->clone;
}
return
$clone
;
};
If the object $object is undef, returns undef, ohterwise calls Cloneable#clone method and its return value.
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License