The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SPVM::Stringer - a callback interface to stringify a object

SYNOPSYS

  use SPVM::Stringer;
  
  my $stringer : SPVM::Stringer = sub : string ($self : self, $object : object) {
    my $point = (SPVM::Point)$object;
    my $x = $point->x;
    my $y = $point->y;
    
    my $string = "($x, $y)";
    
    return $string;
  };
  
  my $point = SPVM::Point->new(1, 2);
  my $string = $stringer->($point);

DESCRIPTION

SPVM::Stringer is a callback interface to stringify a object.

CALLBACK METHOD INTERFACE

  sub : string ($self : self, $object : object)

This method receives a object and return the string expression.

This method is planned to be implemented in other classes.