Handbook
Glossary
compare-with ( quots -- <=> )
Vocabulary
sorting
Inputs
quots
a
sequence
of a
quotation
with stack effect
( obj1 obj2 -- <=> )
Outputs
None
Word description
Generate a chained comparator using the specified
quots
sequence of comparators.
See also
compare
,
natural-sort
,
sort-with
,
inv-sort-with
,
sort-keys
,
sort-values
Definition
USING:
kernel
math.order
sequences
;
IN:
sorting
MACRO:
compare-with
( quots -- <=> )
[
[
bi@
<=>
]
curry
]
[
[
[
drop
]
]
dip
compose
[
[
2keep
rot
dup
+eq+
eq?
]
curry
]
dip
[
[
2nip
]
if
]
curry
compose
]
map-reduce
;