Handbook
Glossary
inv-sort-with ( seq quot: ( elt -- key ) -- sortedseq )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Sorting sequences
Prev:
sort-with ( seq quot: ( elt -- key ) -- sortedseq )
Next:
natural-sort ( seq -- sortedseq )
Vocabulary
sorting
Inputs
seq
a
sequence
quot
a
quotation
with stack effect
( elt -- key )
Outputs
sortedseq
a new sorted sequence
Word description
Sorts the elements of
seq
by applying
compare
with
quot
to each pair of elements in the sequence and inverting the results.
See also
compare
,
natural-sort
,
sort-with
,
sort-keys
,
sort-values
Definition
USING:
kernel
math.order
;
IN:
sorting
:
inv-sort-with
( seq quot: ( elt -- key ) -- sortedseq )
[
compare
invert-comparison
]
curry
sort
;
inline