Name

SPVM::Stringable - Stringable Interface

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 interface in SPVM is the interface for stringable classes.

Interface Methods

to_string

required method to_string : string ();

Returns the string representation for the instance.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License