Handbook
Glossary
human<=> ( obj1 obj2 -- <=> )
Human-friendly sorting
Next:
human>=< ( obj1 obj2 -- >=< )
Vocabulary
sorting
.
human
Inputs
obj1
an
object
obj2
an
object
Outputs
<=>
an ordering specifier
Word description
Compares two objects after converting numbers in the string into integers.
Definition
USING:
kernel
math.order
sorting.human.private
;
IN:
sorting.human
:
human<=>
( obj1 obj2 -- <=> )
2dup
(human)<=>
dup
+eq+
eq?
[
drop
<=>
]
[
2nip
]
if
;