Handbook
Glossary
natural-sort ( seq -- sortedseq )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Sorting sequences
Prev:
inv-sort-with ( seq quot: ( elt -- key ) -- sortedseq )
Next:
sort-keys ( obj -- sortedseq )
Vocabulary
sorting
Inputs
seq
a
sequence
Outputs
sortedseq
a new sorted sequence
Word description
Sorts a sequence of objects in natural order using the
<=>
word.
See also
compare
,
sort-with
,
inv-sort-with
,
sort-keys
,
sort-values
Definition
USING:
math.order
;
IN:
sorting
:
natural-sort
( seq -- sortedseq )
[
<=>
]
sort
;