| 1 | package SPVM::Comparable; | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | 1; | ||
| 6 | |||
| 7 | =head1 Name | ||
| 8 | |||
| 9 | SPVM::Comparable - Comparable Interface | ||
| 10 | |||
| 11 | =head1 Description | ||
| 12 | |||
| 13 | Comparable interface in L<SPVM> has interface methods to compare two objects. | ||
| 14 | |||
| 15 | =head1 Usage | ||
| 16 | |||
| 17 | interface Comparable; | ||
| 18 | |||
| 19 | =head1 Interface Methods | ||
| 20 | |||
| 21 | C<required method cmp : int ($a : object, $b : object);> | ||
| 22 | |||
| 23 | An interface method to compare two objects. | ||
| 24 | |||
| 25 | If $a is greater than $b, returns a positive value. | ||
| 26 | |||
| 27 | If $a is equal to $b, returns 0. | ||
| 28 | |||
| 29 | If $a is less than $b, returns a negative value. | ||
| 30 | |||
| 31 | =head1 Copyright & License | ||
| 32 | |||
| 33 | Copyright (c) 2024 Yuki Kimoto | ||
| 34 | |||
| 35 | MIT License |