Lably
Skip to content

Anonymous function

Function definition that is not bound to an identifier

  • 11 min read
  • 4 chapters

Related on Lably

Through Computer programming, Function (computer programming) and Identifier

Anonymous functions originate in the work of Alonzo Church in his invention of the lambda calculus, in which all functions are anonymous, in 1936, before electronic computers. In several programming languages, anonymous functions are introduced using the keyword lambda, and anonymous functions are often referred to as lambdas or lambda abstractions. Anonymous functions have been a feature of programming languages since Lisp in 1958, and a growing number of modern programming languages support anonymous functions.

Names

The names "lambda abstraction", "lambda function", and "lambda expression" refer to the notation of function abstraction in lambda calculus, where the usual function f(x)=M would be written (λx.M), and where M is an expression that uses x. Compare to the Python syntax of lambda x: M.

The name "arrow function" refers to the mathematical "maps to" symbol, x↦M. Compare to the JavaScript syntax of x => M.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication