BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2024-07-30

enum Order

<p>Human readable form for comparison operators. <span class="indexed" id="index-entry-" data-index-text="Reference,Less"></span><span class="indexed" id="index-entry-_0" data-index-text="Reference,Same"></span><span class="indexed" id="index-entry-_0" data-index-text="Reference,More"></span> </p>

enum Order (:Less(-1), :Same(0), :More(1));
Code

Operators§

infix cmp§

multi infix:<cmp>(\a, \b --> Order:D)
Code

cmp will first try to compare operands as strings (via coercion to Stringy), and, failing that, will try to compare numerically via the <=> operator or any other type-appropriate comparison operator. See also the documentation for the cmp operator.

infix <=>§

multi infix:«<=>»(Int:D \a, Int:D \b --> Order:D)
Code

Specialized form for Int.

Class relation diagram§

Rakudo Type Relation for Order Order Order Int Int Order->Int is