TinyMUX

Zip()

Functions

Description

FUNCTION: zip(<list1>, <list2>[, <isep>[, <osep>]])

Interleaves two lists element by element. Elements are taken alternately from each list. If one list is longer than the other, the extra elements are appended to the result.

An optional input separator and output separator may be specified.

Examples

> say zip(a b c, 1 2 3)

You say, “a 1 b 2 c 3”

> say zip(a b c d, 1 2)

You say, “a 1 b 2 c d”

iter(), mix()