at+ ( n key assoc -- )
Factor documentation > Factor handbook > The language > Collections > Associative mapping operations > Storing keys and values in assocs
Prev:change-at ( ..a key assoc quot: ( ..a value -- ..b newvalue ) -- ..b )
Next:inc-at ( key assoc -- )


Vocabulary
assocs

Inputs and outputs
na number
keyan object
assocan assoc


Word description
Adds n to the value associated with key; if there is no value, stores n, thus behaving as if the value was 0.

Side effects
Modifies assoc

Definition
USING: kernel math ;

IN: assocs

: at+ ( n key assoc -- ) [ 0 or + ] change-at ; inline