Handbook
Glossary
change-at ( ..a key assoc quot: ( ..a value -- ..b newvalue ) -- ..b )
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Storing keys and values in assocs
Prev:
rename-at ( newkey key assoc -- )
Next:
at+ ( n key assoc -- )
Vocabulary
assocs
Inputs
key
an
object
assoc
an
assoc
quot
a
quotation
with stack effect
( ..a value -- ..b newvalue )
Outputs
None
Word description
Applies the quotation to the value associated with
key
, storing the new value back in the assoc.
Side effects
Modifies
assoc
See also
?change-at
,
change-nth
,
change
Definition
USING:
kernel
;
IN:
assocs
:
change-at
( ..a key assoc quot: ( ..a value -- ..b newvalue ) -- ..b )
[
[
at
]
dip
call
]
[
drop
]
3bi
set-at
;
inline