Handbook
Glossary
value-at* ( value assoc -- key/f ? )
Factor handbook
»
The language
»
Collections
»
Associative mapping operations
»
Transposed assoc operations
Prev:
value-at ( value assoc -- key/f )
Next:
value? ( value assoc -- ? )
Vocabulary
assocs
Inputs
value
an
object
assoc
an
assoc
Outputs
key/f
the key associated to the value or
f
?
a
boolean
Word description
Looks up the key associated with a value. The boolean flag can decide between the case of a missing key, and a key of
f
.
Definition
IN:
assocs
GENERIC:
value-at*
( value assoc -- key/f ? )
Methods
USING:
assocs
kernel
;
M:
assoc
value-at*
swap
[
=
nip
]
curry
assoc-find
nip
;
USING:
accessors
assocs
biassocs
;
M:
biassoc
value-at*
to>>
at*
;
inline