associate ( value key -- hash ) (original) (raw)
associate ( value key -- hash )
Factor handbook » The language » Collections » Hashtables » Hashtable utilities
Next: | ?set-at ( value key assoc/f -- assoc ) |
---|
Vocabulary
hashtables
Inputs
value | a value |
---|---|
key | a key |
Outputs
hash | a new hashtable |
---|
Word description
Create a new hashtable holding one key/value pair.
Definition
USING: hashtables.private kernel ;
: associate ( value key -- hash )
[ 1 0 ] 2dip 1 [ 2dup hash@ set-nth-pair ] keep
hashtable boa ; inline