zip-index ( keys -- alist )
Factor handbook » The language » Collections » Associative mapping operations » Associative mapping conversions

Prev:zip-as ( keys values exemplar -- assoc )
Next:zip-index-as ( keys exemplar -- assoc )


Vocabulary
assocs

Inputs
keysa sequence


Outputs
alistan array of key/value pairs


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


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

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

Definition