sort ( seq -- sortedseq ) (original) (raw)

sort ( seq -- sortedseq )
Factor handbook » The language » Collections » Sequence operations » Sorting sequences

Prev: sort-with ( ... seq quot: ( ... obj1 obj2 -- ... <=> ) -- ... sortedseq )
Next: inv-sort ( seq -- 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-by, inv-sort-by, sort-keys, sort-values

Definition

USING: math.order ;

IN: sorting

: sort ( seq -- sortedseq ) [ <=> ] sort-with ;