Handbook
Glossary
smart-reduce ( reduce-quots -- quot )
Vocabulary
combinators
.
smart
Inputs
reduce-quots
a
sequence
Outputs
None
Word description
A version of
reduce
that takes a sequence of
{ identity reduce-quot }
pairs, returning the
reduce
result for each pair.
Definition
USING:
assocs
generalizations
kernel
sequences
;
IN:
combinators.smart
MACRO:
smart-reduce
( reduce-quots -- quot )
unzip
[
[
]
like
]
bi@
dup
length
dup
[
[
cleave-curry
]
curry
compose
]
dip
[
spread*
]
curry
compose
[
[
dip
]
curry
]
dip
[
each
]
curry
compose
;