
zip - combines lists element-by-element

Calling sequence:

zip(list_1, list_2, func)
zip(list_1, list_2, func, expr)

Parameter:
list_1, list_2  --   lists
func            --   function
expr            --   expression

Overloading:

1,2

Summary:

zip combines the lists list_1 and list_2 element-by-element. The function
func is called with all pairs list_1[i], list_2[i] as arguments one after
the other and the results of the function calls are combined into a new list.

The call of func has the form

    func(list_1[i], list_2[i])

for each pair of list elements. If the two lists are of different lengths then the
functionality is dependent on the optional fourth parameter expr:

  o  If the fourth parameter is missing then func is applied only to the first
     n list elements, whereby n is the length of the shorter list.

  o  If a fourth parameter is given then this is used as the default value
     instead of the \missing" list elements in the shorter list.

zip is a kernel function.

>>  zip([a, b, c, d], [x, y], _plus);

      [a + x, b + y]

>>  zip([a, b, c, d], [x, y], _plus, 0);

      [a + x, b + y, c, d]

See also:  map

