In computer programming, an anonymous function (also function constant, function literal, or lambda function) is a function (or a subroutine) defined, and possibly called, without being bound to an identifier. Anonymous functions are convenient to pass as an argument to a higher-order function and are ubiquitous in languages with first-class functions such as Haskell. Anonymous functions are a form of nested function, in that they allow access to the variable in the scope of the containing function (non-local variables). Unlike named nested functions, they cannot be recursive without the assistance of a fixpoint operator (also known as an anonymous fixpoint or anonymous recursion).
Anonymous functions originate in the work of Alonzo Church in his invention of the lambda calculus in 1936 (prior to electronic computers), in which all functions are anonymous. In several programming languages, anonymous functions are introduced using the keyword lambda, and anonymous functions are often referred to as lambda functions.
Other articles related to "anonymous function, function, anonymous functions, anonymous":
... Main article Anonymous function For example in Lisp the 'square' function can be expressed as a lambda expression as follows (lambda (x) (* x x)) or ... The symbol lambda creates an anonymous function, given a list of parameter names, (x) — just a single argument in this case, and an expression that is evaluated as the body of the function, (* x x) ... Anonymous functions are sometimes called lambda expressions ...
... Anonymous functions (in general anonymous predicates) were introduced in Visual Prolog in version 7.2 ... Anonymous predicates can capture values from the context ... mkAdder returns an anonymous function, which has captured the argument X in the closure ...
Famous quotes containing the word function:
“... The states one function is to give.
The bud must bloom till blowsy blown
Its petals loosen and are strown;
And thats a fate it cant evade
Unless twould rather wilt than fade.”
—Robert Frost (18741963)