Vocabulary
assocs

Inputs
seqa sequence
quota quotation with stack effect ( ... key -- ... value )


Outputs
alistan assoc


Examples
USING: assocs math prettyprint ; { 1 2 3 4 } [ sq ] zip-with .
{ { 1 1 } { 2 4 } { 3 9 } { 4 16 } }


Word description
Zip a sequence with values generated by applying quot to each element in the sequence.

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

Definition

: zip-with
( ... seq quot: ( ... key -- ... value ) -- ... alist )
{ } zip-with-as ; inline