?set-at ( value key assoc/f -- assoc )
Factor handbook > The language > Collections > Hashtables > Hashtable utilities

Prev:associate ( value key -- hash )


Vocabulary
hashtables

Inputs and outputs
valuean object
keyan object
assoc/fan assoc or f
assocan 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


: ?set-at ( value key assoc/f -- assoc )
[ [ set-at ] keep ] [ associate ] if* ;