
map - applies a function to operands

Calling sequence:
map(expr, func)
map(expr, func, expr_1 ...)

Parameter:
expr     --  expression
func     --  function
expr_1   --  expression

Overloading:

1

Summary:

map maps the functionfunc to all operands of the expression expr. When
func is called the expressions expr_1 ... are used as additional parameters.

For each operand opd of expr the call of func has the form

    func(opd, expr_1 ...)

The results of the function calls are then inserted in the expression expr
instead of the old operands.

If the first argument expr is an expression sequence, than this sequence is
not flattend. If the argument is a rational or complex number, then func is
applied to the number and not to its parts as given by op.

If expr is a list, set, table or array then the function is applied to the
individual elements of the relevant data structure. map is a kernel function.

>>  map(a+b+3, sin);

      sin(a) + sin(b) + sin(3)

>>  map(a+b+3, f, x, y);

      f(a,x,y) + f(b,x,y) + f(3,x,y)

>>  map([1,x], _plus, 12);

      [13, x+12]

See also:  op, select , subsop , zip

