Handbook
Glossary
assoc-collapse-as ( seq quot: ( value1 value2 -- new-value ) exemplar -- assoc )
Vocabulary
assocs
.
extras
Inputs
seq
an
object
quot
a
quotation
with stack effect
( value1 value2 -- new-value )
exemplar
an
object
Outputs
assoc
an
object
Definition
USING:
assocs
kernel
sequences
;
IN:
assocs.extras
:
assoc-collapse-as
( seq quot: ( value1 value2 -- new-value ) exemplar -- assoc )
pick
first
assoc-size
swap
new-assoc
-rot
assoc-collapse!
;
inline