Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
invert-comparison ( <=> -- >=< )
Factor documentation
>
Factor handbook
>
The language
>
Objects
>
Linear order protocol
Prev:
compare ( obj1 obj2 quot -- <=> )
Next:
Ordering specifiers
Vocabulary
math.order
Inputs and outputs
<=>
an ordering specifier
>=<
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
;