compare ( obj1 obj2 quot -- <=> )
Factor handbook > The language > Objects > Linear order protocol

Prev:>=< ( obj1 obj2 -- >=< )
Next:invert-comparison ( <=> -- >=< )


Vocabulary
math.order

Inputs and outputs
obj1an object
obj2an object
quota quotation with stack effect ( obj -- newobj )
<=>an ordering specifier


Word description
Compares the results of applying the quotation to both objects via <=>.

Examples
USING: kernel math.order prettyprint sequences ; "hello" "hi" [ length ] compare .
+gt+


See also
natural-sort, sort-with, inv-sort-with, sort-keys, sort-values

Definition


: compare ( obj1 obj2 quot -- <=> ) bi@ <=> ; inline