assoc-each ( ... assoc quot: ( ... key value -- ... ) -- ... )
Factor handbook > The language > Collections > Associative mapping operations > Associative mapping combinators

Next:assoc-find ( ... assoc quot: ( ... key value -- ... ? ) -- ... key value ? )


Vocabulary
assocs

Inputs and outputs
assocan assoc
quota quotation with stack effect ( ... key value -- ... )


Word description
Applies a quotation to each entry in the assoc.

Examples
USING: assocs kernel math prettyprint ; H{ { "bananas" 5 } { "apples" 42 } { "pears" 17 } } 0 swap [ nip + ] assoc-each .
64


Definition


: assoc-each
( ... assoc quot: ( ... key value -- ... ) -- ... )
(assoc-each) each ; inline