This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# Apply

 Applyor replaces the head of expr by f. Applyor replaces heads at level of expr by f. Applyreplaces heads in parts of expr specified by levelspec.
• Apply uses standard level specifications:
 n levels through n Infinity levels through Infinity {n} level n only {n1,n2} levels through
• The default value for levelspec in Apply is .
• is equivalent to Apply.
• A positive level n consists of all parts of expr specified by n indices.
• A negative level -n consists of all parts of expr with depth n.
• Level consists of numbers, symbols, and other objects that do not have subparts.
• Level corresponds to the whole expression.
• Apply always effectively constructs a complete new expression and then evaluates it.
• Apply operates on SparseArray objects just as it would on the corresponding ordinary lists.
Apply gets rid of a level of lists:
 Out[1]=
 Out[2]=
 Out[3]=

Apply gets rid of a level of lists:
 Out[1]=
 Scope   (10)
Apply at level (default):
Apply at level :
The short form is equivalent to applying at level :
Apply at levels and :
Apply down to level (excluding level ):
Apply at levels through :
Apply at all levels, starting at level :
Apply also at level :
Negative levels:
Positive and negative levels can be mixed:
Apply also inside heads at the levels specified:
Apply works with any head, not just List:
Apply works on sparse arrays:
 Options   (1)
Apply inside heads as well as arguments:
 Applications   (3)
Display the factorization of an integer using superscripts:
Create a table from a list of range specifications:
Turn a function that takes several arguments into one that takes a list of arguments:
Leaves are visited before roots:
Total does effectively the same thing as applying Plus to a list:
Using in a pure function has the same effect as using Apply:
Three ways to apply a function at level :
Ordinary function application takes the list as a single argument:
Apply takes the elements of the list as separate arguments:
Applying to atomic objects that do not have subparts effectively does nothing: