Handbook
Glossary
invert-comparison ( <=> -- >=< )
Factor handbook
»
The language
»
Objects
»
Linear order protocol
Prev:
compare ( obj1 obj2 quot -- <=> )
Next:
Ordering specifiers
Vocabulary
math
.
order
Inputs
<=>
an ordering specifier
Outputs
>=<
an ordering specifier
Word description
Invert the comparison symbol returned by
<=>
.
Examples
USING: math.order prettyprint ; +lt+ invert-comparison .
+gt+
Definition
USING:
kernel
;
IN:
math.order
:
invert-comparison
( <=> -- >=< )
dup
+lt+
eq?
[
drop
+gt+
]
[
+eq+
eq?
+eq+
+lt+
?
]
if
;