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

Name

SPVM::Stringable - A Interface Type to Stringify a Object

Usage

  class Point {
    interface Stringable;
  
    method to_string : string ();
      my $x = $sel->x;
      my $y = $sel->y;
      
      my $string = "($x,$y)";
      
      return $string;
    };
  }

Description

Stringable is an interface type to stringify a object.

Interface Methods

Interface methods.

to_string

  required method to_string : string ();

The implementation must return the string expression.