Handbook
Glossary
sort-with-spec-by ( seq sort-spec quot: ( obj -- key ) -- sortedseq )
Vocabulary
sorting
.
specification
Inputs
seq
an
object
sort-spec
an
object
quot
a
quotation
with stack effect
( obj -- key )
Outputs
sortedseq
an
object
Definition
USING:
kernel
sorting
;
IN:
sorting.specification
:
sort-with-spec-by
( seq sort-spec quot: ( obj -- key ) -- sortedseq )
swap
[
[
bi@
]
curry
]
dip
[
compare-with-spec
]
curry
compose
sort-with
;
inline