Anonymous Function
An Anonymous Function is a software function that is an unnamed software object.
- AKA: Lambda Abstraction, Lambda Expression.
- …
- Example(s):
- Counter-Example(s):
- See: Name Binding, Higher-Order Function, Functional Programming Language, First-Class Function, Function Type, Data Type, Lambda Calculus.
References
2014
- (Wikipedia, 2014) ⇒ http://en.wikipedia.org/wiki/anonymous_function Retrieved:2014-8-1.
- In computer programming, an anonymous function (also function literal or lambda abstraction) is a function definition that is not bound to an identifier. Anonymous functions are often:
- passed as arguments to higher-order functions, or
- used to construct the result of a higher-order function that needs to return a function.
- If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function. Anonymous functions are ubiquitous in functional programming languages and other languages with first-class functions, where they fulfil the same role for the function type as literals do for other data types.
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's or lambda abstractions. Anonymous functions have been a feature of programming languages since Lisp in 1958 and an increasing number of modern programming languages support anonymous functions.
Anonymous functions are a form of nested function, in that they allow access to variables in the scope of the containing function (non-local variables). This means anonymous functions need to be implemented using closures. Unlike named nested functions, they cannot be recursive without the assistance of a fixpoint operator (also known as an anonymous fixpoint or anonymous recursion).
- In computer programming, an anonymous function (also function literal or lambda abstraction) is a function definition that is not bound to an identifier. Anonymous functions are often:
2013
- http://docs.python.org/2/glossary.html#term-lambda
- An anonymous inline function consisting of a single expression which is evaluated when the function is called. The syntax to create a lambda function is lambda [arguments]: expression