Name: Apply - calls a function with the elements of an array as argument

Synopsis:

array proc Apply -&gt; any


Examples:

[1 2] {add} Apply --&gt; 3 
[1 2] {dup mul} Map --&gt; [1 4] 
[(hell world) 4 (o)] {insert} Apply --&gt; (hello world)


Description:

Apply interprets the elements of the input array a as the list 
of arguments of the supplied function f, 
f(a(1),a(2), ...,a(n)) 
This is to be distinguished from Map which individually applies 
the function to the elements of the array, 
[f(a(1),f(a(2), ...,f(a(n))]


Parameters:

array is an arbitrarily shaped heterogeneous array. 
proc is any procedure object (pure function).


Remarks:

This function is an implementation of Mathematica's Apply function.


References:

[1] The Mathematica Book V4.0 "Apply"


Author:

Diesmann


FirstVersion:

unknown, documented 121124


SeeAlso:

Map
MapAt
MapThread

Source:

/var/www/debian/nest/nest-simulator-2.20.0/lib/sli/mathematica.sli
