Documentation for sub infix:<cmp>
assembled from the following pages:
Class: DateTime §
From DateTime
(DateTime) sub infix:<cmp> §
multi sub infix:<cmp>(DateTime \a, DateTime \b --> Order)
Compares the equivalent instant, returns the Order.
Class: Range §
From Range
(Range) sub infix:<cmp> §
multi sub infix:<cmp>(Range \a, Range \b --> Order)multi sub infix:<cmp>(Num(Real) \a, Range \b --> Order)multi sub infix:<cmp>(Range \a, Num(Real) \b --> Order)multi sub infix:<cmp>(Positional \a, Range \b --> Order)multi sub infix:<cmp>(Range \a, Positional \b --> Order)
Compares two Range objects. A Real
operand will be considered as both the starting point and the ending point of a Range to be compared with the other operand. A Positional
operand will be compared with the list returned by the .list
method applied to the other operand. See List infix:<cmp>
say (1..2) cmp (1..2); # OUTPUT: «Same» say (1..2) cmp (1..3); # OUTPUT: «Less» say (1..4) cmp (1..3); # OUTPUT: «More» say (1..2) cmp 3; # OUTPUT: «Less» say (1..2) cmp [1,2]; # OUTPUT: «Same»