Handbook
Glossary
assoc-collapse ( seq quot: ( value1 value2 -- new-value ) -- assoc )
Vocabulary
assocs
.
extras
Inputs
seq
an
object
quot
a
quotation
with stack effect
( value1 value2 -- new-value )
Outputs
assoc
an
object
Definition
USING:
kernel
sequences
;
IN:
assocs.extras
:
assoc-collapse
( seq quot: ( value1 value2 -- new-value ) -- assoc )
over
empty?
[
2drop
f
]
[
[
unclip-slice
H{
}
or
clone
]
[
[
assoc-merge!
]
curry
]
bi*
reduce
]
if
;
inline