Handbook
Glossary
?set-at ( value key assoc/f -- assoc )
Factor handbook
»
The language
»
Collections
»
Hashtables
»
Hashtable utilities
Prev:
associate ( value key -- hash )
Vocabulary
hashtables
Inputs
value
an
object
key
an
object
assoc/f
an assoc or
f
Outputs
assoc
an
assoc
Word description
If the third input is an assoc, stores the key/value pair into that assoc, or else creates a new hashtable with the key/value pair as its only entry.
Definition
USING:
assocs
kernel
;
IN:
hashtables
:
?set-at
( value key assoc/f -- assoc )
[
[
set-at
]
keep
]
[
associate
]
if*
;