Handbook
Glossary
human>=< ( obj1 obj2 -- >=< )
Human-friendly sorting
Prev:
human<=> ( obj1 obj2 -- <=> )
Next:
find-numbers ( sequence -- sequence' )
Vocabulary
sorting
.
human
Inputs
obj1
an
object
obj2
an
object
Outputs
>=<
an ordering specifier
Word description
Compares two objects using the
human<=>
word and inverts the result.
Definition
USING:
kernel
math.order
sorting.human.private
;
IN:
sorting.human
:
human>=<
( obj1 obj2 -- >=< )
2dup
(human)>=<
dup
+eq+
eq?
[
drop
>=<
]
[
2nip
]
if
;