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

NAME

SPVM::Comparator::Byte - Comparator::Byte in SPVM | a callback interface for byte comparation

SYNOPSYS

  use Comparator::Byte;
  
  my $comparator : Comparator::Byte = method : int ($a : byte, $b : byte); {
    return $a <=> $b;
  };
  
  my $result = $comparator->(3, 5);

DESCRIPTION

Comparator::Byte is a callback interface to compare two byte values.

CALLBACK METHOD INTERFACE

  method : int ($a : byte, $b : byte);

This method must receive two numbers and return 1 if $a is more than $b, -1 if $x is less than $b, 0 if $a equals $b in the implementation.

This method is planned to be implemented in other classes.