Anonymous Function

From GM-RKB
(Redirected from Lambda expression)
Jump to navigation Jump to search

An Anonymous Function is a software function that is an unnamed software object.



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:
      1. passed as arguments to higher-order functions, or
      2. 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).

2013