Sorting by multiple keys


The sorting.specification vocabulary can sort objects by multiple keys in ascending or descending order, using subsequent keys as tie-breakers.

Comparing two objects with a sorting specification:
compare-with-spec ( obj1 obj2 sort-spec -- <=> )


Sorting a sequence of objects with a sorting specification:
sort-with-spec ( seq sort-spec -- seq' )

sort-keys-with-spec ( assoc sort-spec -- alist )

sort-values-with-spec ( assoc sort-spec -- alist )