Handbook
Glossary
?of ( assoc key -- value/key ? )
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Lookup and querying of assocs
Prev:
of ( assoc key -- value/f )
Next:
value-at ( value assoc -- key/f )
Vocabulary
assocs
Inputs
assoc
an
assoc
key
an
object
Outputs
value/key
the value associated to the key, or the key if the key is not present in the assoc
?
a
boolean
indicating if the key was present
Word description
Looks up the value associated with a key. If the key was not present, an error can be thrown without extra stack shuffling. This word handles assocs that store
f
.
See also
at
,
at*
,
key?
,
?at
,
of
Definition
USING:
kernel
;
IN:
assocs
:
?of
( assoc key -- value/key ? )
swap
?at
;
inline