notes src lambdas.md
698 B 17 lines
Markdown
at main

Lambdas #

Lambdas are @[functions][] that are typically:

  1. defined within another function; and
  2. capture (for later reference) values from the context in which they were defined.

They are also often called anonymous functions because they often use a different syntax than regular functions, which does not include a name.

Lambdas are featured in most languages these days, but are of particular note in some common ones that I care about such as:

  • Javascript (both regular functions and @[arrow functions][js-arrow-functions] can be used like lambdas)
  • @[Rust][rs-lambda]
  • @[Haskell][hs-lambda]
  • @[C++][cpp-lambda]

The name "lambda" comes from the @[Lambda Calculus][].