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 } }
}