0 else n1 * f(f, n1 - 1) fact = F(fact1) Written anonymously: (lambda f: (lambda x: f(f, x))) \ (lambda g, n1: 1 if n1 == 0 else n1 * g(g, n1 - 1)) In the lambda calculus, which only uses functions of a single variable, this can be done via the Y combinator. First make the higher-order function of two variables be a function of a single variable, which directly returns a function, by currying: fact1 = lambda f: (lambda n1: 1 if n1 == 0 else n1 * f(f)(n1 - 1)) fact = fact1(fact1) There are two "applying a higher order function to itself" operations here: f(f) in the first line and fact1(fact1) in the second. Factoring out the second double application into a combinator yields: C = lambda x: x(x) fact1 = lambda f: (lambda n1: 1 if n1 == 0 else n1 * f(f)(n1 - 1)) fact = C(fact1) Factoring out the other double application yields: C = lambda x: x(x) D = lambda f: (lambda x: f(lambda v: x(x)(v))) fact1 = lambda g: (lambda n1: 1 if n1 == 0 else n1 * g(n1 - 1)) fact = C(D(fact1)) Combining the two combinators into one yields the Y combinator: C = lambda x: x(x) D = lambda f: (lambda x: f(lambda v: x(x)(v))) Y = lambda y: C(D(y)) fact1 = lambda g: (lambda n1: 1 if n1 == 0 else n1 * g(n1 - 1)) fact = Y(fact1) Expanding out the Y combinator yields: Y = lambda f: (lambda x: f(lambda v: x(x)(v))) \ (lambda x: f(lambda v: x(x)(v))) fact1 = lambda g: (lambda n1: 1 if n1 == 0 else n1 * g(n1 - 1)) fact = Y(fact1) Combining these yields a recursive definition of the factorial in lambda calculus (anonymous functions of a single variable): (lambda f: (lambda x: f(lambda v: x(x)(v))) (lambda x: f(lambda v: x(x)(v)))) \ (lambda g: (lambda n1: 1 if n1 == 0 else n1 * g(n1 - 1))) Examples APL In APL, the current dfn is accessible via ∇. This allows anonymous recursion, such as in this implementation of the factorial: {0=⍵:1 ⋄ ⍵×∇ ⍵-1} 5 120 {0=⍵:1 ⋄ ⍵×∇ ⍵-1}¨ ⍳10 ⍝ applied to each element of 0 to 9 1 1 2 6 24 120 720 5040 40320 362880 JavaScript In JavaScript, the current function is accessible via arguments.callee, while the calling function is accessible