The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::Comparable - Comparable Interface

Description

Comparable interface in SPVM has interface methods to compare two objects.

Usage

  interface Comparable;

Interface Methods

required method cmp : int ($a : object, $b : object);

An interface method to compare two objects.

If $a is greater than $b, returns a positive value.

If $a is equal to $b, returns 0.

If $a is less than $b, returns a negative value.

Copyright & License

Copyright (c) 2024 Yuki Kimoto

MIT License