++ed by:
AZJADFTRE HAMMER KRAUTCAT ILUX SKOLYCHEV

13 PAUSE users
5 non-PAUSE users.

Yuki Kimoto

NAME

SPVM::Cloner - a callback type to clone a object

SYNOPSYS

  use SPVM::Cloner;
  
  my $cloner : SPVM::Cloner = sub : object ($self : self, $obj : object) {
    my $point = (SPVM::Point)$obj;
    
    my $new_point = SPVM::Point->new($point->x, $point->y);
    
    return $new_point;
  };
  
  my $point = SPVM::Point->new(1, 2);
  my $point_clone = $cloner->($point);

DESCRIPTION

SPVM::Cloner is a callback type to clone a object.

CALLBACK METHOD

  sub : object ($self : self, $obj : object);

This method should be cloned object in the method implementation.