Anonymous recursion
Appearance
Anonymous recursion refers to the construction and existence of anonymously recursive functions. Given an n-argument recursive function f defined in terms of itself, it is possible to define an equivalent recursive anonymous function f* which is not defined in terms of itself. The procedure is the following:
- Define an (n+1)-argument function h in terms of f the same way that f was defined in terms of itself, and let h′s last argument be f. (Function h inherits its first n arguments from f.)
- Change f, the last argument of h, from an n-argument function to an (n+1)-argument function by feeding f to itself as f′s last argument for all instances of f within the definition of h. (This puts function h and its last argument f on an equal footing.)
- Pass on h to itself as h′s own last argument, and let this be the definition of the desired n-argument recursive anonymous function f*:
where
- in terms of
in the same way as
- in terms of