extract-keys ( seq assoc -- subassoc )
Factor handbook » The language » Collections » Associative mapping operations » Set-theoretic operations on assocs

Prev:substitute ( seq assoc -- newseq )
Next:assoc-union! ( assoc1 assoc2 -- assoc1 )


Vocabulary
assocs

Inputs
seqa sequence
assocan assoc


Outputs
subassocan assoc


Word description
Outputs an new assoc with key/value pairs whose keys match the elements in the input seq.

Examples
USING: prettyprint assocs ; { 1 3 } { { 1 10 } { 2 20 } { 3 30 } } extract-keys .
{ { 1 10 } { 3 30 } }


Definition