VocabularyassocsInputsassoc | an assoc |
quot | a quotation with stack effect ( ... key value -- ... newkey newvalue ) |
OutputsWord descriptionApplies the quotation to each entry in the input assoc and collects the results in a new assoc of the same type as the input.
Examples: discount ( prices n -- newprices )
[ - ] curry assoc-map ;
H{ { "bananas" 5 } { "apples" 42 } { "pears" 17 } }
2 discount .
H{ { "bananas" 3 } { "apples" 40 } { "pears" 15 } }
See alsoassoc-map-asDefinition