zip-index-as ( values exemplar -- assoc )
Factor handbook » The language » Collections » Associative mapping operations » Associative mapping conversions

Prev:zip-index ( values -- alist )
Next:zip-with ( ... seq quot: ( ... key -- ... value ) -- ... alist )


Vocabulary
assocs

Inputs
valuesa sequence
exemplara sequence


Outputs
assocan assoc


Examples
Zip a sequnce with its indices as a vector:
USING: assocs prettyprint ; { 100 200 300 } V{ } zip-index-as .
V{ { 100 0 } { 200 1 } { 300 2 } }


Word description
Zip a sequence with its index and return an associative list of type exemplar where the input sequence is the keys and the indices are the values.

See also
unzip, zip, zip-as, zip-index, zip-with, zip-with-as

Definition