Go to the first, previous, next, last section, table of contents.
- map(function,arg0,arg1,...)
-
:: Applies a function to each member of a list or an array.
- return
-
an object of the same type as arg0.
- function
-
the name of a function
- arg0
-
list, vector or matrix
- arg1, ...
-
arbitrary (the rest of arguments)
-
Returns an object of the same type as arg0. Each member of the
returned object is the return value of a function call where the first
argument is the member of arg0 corresponding to the member in
the returned object and the rest of the argument are arg1,
....
-
function is a function name itself without `"'.
-
A program variable cannot be used as function.
-
If arg0 is neither list nor array this function simply
returns the value of function(arg0,arg1,...).
[82] def afo(X) { return X^3; }
[83] map(afo,[1,2,3]);
[1,8,27]
Go to the first, previous, next, last section, table of contents.