Associative mapping conversions
Factor handbook » The language » Collections » Associative mapping operations

Prev:Set-theoretic operations on assocs


Converting to other assocs:
assoc-clone-like ( assoc exemplar -- newassoc )


Combining a sequence of assocs into a single assoc:
assoc-union-all ( seq -- union )


Creating an assoc from key/value sequences:
zip ( keys values -- alist )

zip-as ( keys values exemplar -- assoc )


Creating an assoc from key/value sequences and their indices:
zip-index ( values -- alist )

zip-index-as ( values exemplar -- assoc )


Creating an assoc from a sequence and a key quotation:
zip-with ( ... seq quot: ( ... key -- ... value ) -- ... alist )

zip-with-as ( ... seq quot: ( ... key -- ... value ) exemplar -- ... assoc )


Creating key/value sequences from an assoc:
unzip ( assoc -- keys values )