Handbook
Glossary
at+ ( n key assoc -- )
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
n
a
number
key
an
object
assoc
an
assoc
Outputs
None
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