sort-with-spec ( seq sort-spec -- seq' )
Sorting by multiple keys

Prev:compare-with-spec ( obj1 obj2 sort-spec -- <=> )
Next:sort-keys-with-spec ( assoc sort-spec -- alist )


Vocabulary
sorting.specification

Inputs
seqa sequence
sort-speca sequence of sequences of accessors and a comparator


Outputs
seq'a sequence


Word description
Sorts a sequence of objects by the sorting specification in sort-spec. A sorting specification is a sequence of sequences, each consisting of accessors and a comparator.

Examples
Sort by slot a, then b descending:
USING: accessors math.order prettyprint sorting.specification ; IN: scratchpad TUPLE: sort-me a b ; { T{ sort-me f 2 3 } T{ sort-me f 3 2 } T{ sort-me f 4 3 } T{ sort-me f 2 1 } } { { a>> <=> } { b>> >=< } } sort-with-spec .
{ T{ sort-me { a 2 } { b 3 } } T{ sort-me { a 2 } { b 1 } } T{ sort-me { a 3 } { b 2 } } T{ sort-me { a 4 } { b 3 } } }


Definition