Lambda (Anonymous Function)

A lambda, also called an anonymous function or function literal, is a function defined inline without being given a name. In SICP, the classic text on Scheme, the construct is introduced directly: “Lambda is used to create procedures in the same way as define, except that no name is specified for the procedure.” The name comes from the lambda calculus, the mathematical model of computation in which all functions are anonymous.

Lambdas are the everyday face of first-class functions: because a function can be created on the spot and passed around like any other value, you can hand a small piece of behavior straight to another function without first declaring and naming it. SICP uses lambdas this way to supply procedures as arguments to higher-order procedures such as sum.

In modern languages the idea appears with compact syntax. JavaScript’s arrow functions, per MDN, allow forms like param => expression, where const add = (a, b) => a + b; defines a function that “implicitly returns a + b.” Similar inline-function syntax exists across Python (lambda), C# (the => operator), Java, and most other contemporary languages.

The practical value of lambdas is brevity and locality: short, throwaway functions can be written exactly where they are used, especially as arguments to operations like map, filter, and reduce, keeping the logic close to the data it transforms.