Handbook
Glossary
compare-with ( quots -- <=> )
Vocabulary
sorting
.
extras
Inputs
quots
a
sequence
of a
quotation
with stack effect
( obj -- key )
Outputs
None
Word description
Generate a chained comparator using the specified
quots
sequence of comparators.
Definition
USING:
kernel
math.order
sequences
;
IN:
sorting.extras
MACRO:
compare-with
( quots -- <=> )
[
[
bi@
<=>
]
curry
]
[
[
[
drop
]
]
dip
compose
[
[
2check
dup
+eq+
eq?
]
curry
]
dip
[
[
2nip
]
if
]
curry
compose
]
map-reduce
;