Skip to content

Slot

# serves as a pure function's first parameter.

#n serves as a pure function's n'th parameter.

Attributes[Slot] := {NHoldAll, Protected}

Simple examples

In[1]:= Function[1 + Slot[1]][x]
Out[1]= 1 + x
In[2]:= Function[1 + Slot[1] + 2*Slot[2]][x, y]
Out[2]= 1 + x + 2*y
In[3]:= Slot[1] === Slot[1]
Out[3]= True
In[4]:= Slot[2] === Slot[2]
Out[4]= True
In[5]:= Function[4*Slot[1] + Function[2*Slot[1]][a]][b]
Out[5]= 2*a + 4*b