This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Slot


represents the first argument supplied to a pure function.
#n
represents the ^(th) argument.
  • is used to represent arguments or formal parameters in pure functions of the form body& or Function[body].
  •  is equivalent to Slot.
  • #n is equivalent to Slot[n]. n must be a non-negative integer.
  • gives the head of the function, i.e., the pure function itself.
represents the first argument of a pure function:
Use numbered arguments:
represents the first argument of a pure function:
In[1]:=
Click for copyable input
Out[1]=
 
Use numbered arguments:
In[1]:=
Click for copyable input
Out[1]=
is short for #1, the first argument:
stands for the whole pure function:
Programmatically create a pure function of 5 arguments:
allows function arguments to be referenced without giving them names:
Additional arguments are ignored:
stands for the sequence of all arguments:
Use explicit names to set up nested pure functions:
Use for the inner function:
Use for the outer function:
Using nested notation behaves differently:
If too few arguments are provided, a message is generated:
A recursive definition for factorial using :
New in 1