It seems quite a few mainstream languages support function literals these days. They are also called anonymous functions, but I don\'t care if they have a name. The important th
It also seems Mathematica lets you define recursive functions using #0
to denote the function itself, as:
(expression[#0]) &
e.g. a factorial:
fac = Piecewise[{{1, #1 == 0}, {#1 * #0[#1 - 1], True}}] &;
This is in keeping with the notation #i
to refer to the ith parameter, and the shell-scripting convention that a script is its own 0th parameter.