Lambda
A lambda is a language construct that defines an unnamed function or callable, often as a value.
Kotlin in Action, 2E
A function literal is source syntax that directly expresses a function value, including its parameters and body.
- How it is used
- Passes small behavior blocks to event handlers, collection operations, and higher-order functions.
- How deep it goes
- Explains syntax, inference, captures, Java conversion, and labeled-return edge cases; defers inline implementation details.
- Examples
- Demonstrates click listeners, oldest-person selection, response counting, Java Runnable calls, and labeled collection iteration.
- What you can do after
- Apply it via Kotlin standard-library and Java functional-interface APIs to express reusable behavior concisely.
The Well-Grounded Rubyist, Fourth Edition
A lambda is a Ruby callable object representing an anonymous function with lambda-specific argument and return behavior.
- How it is used
- Uses lambdas as stored callable functions and reusable transformations.
- How deep it goes
- Explains construction, strict arity, explicit creation, and return behavior through calls and contrasts, then applies currying without detailing Proc internals.
- Examples
- Tests missing and extra arguments, contrasts return behavior, multiplies two values, and curries an array filter.
- What you can do after
- Build it from scratch with `lambda` or `->`, and apply `curry` to make reusable functions.
Read how The Well-Grounded Rubyist, Fourth Edition explains lambda →
Pro ASP.NET Core 7, Tenth Edition
A lambda expression is an anonymous function expression whose parameters and implementation can be used as a delegate or compatible callable value.
- How it is used
- Supplies inline filtering rules, endpoint functions, and Blazor event callbacks without a separate method for each behavior.
- How deep it goes
- Works through delegate-compatible filtering and lambda syntax, then demonstrates expression-bodied members; does not examine compiler internals.
- Examples
- Uses product-price and name filters, an expression-bodied controller action, an endpoint function, and generated counter buttons.
- What you can do after
- Apply it in C# to supply filtering rules, concise members, endpoint handlers, and parameterized Blazor event handlers.
Read how Pro ASP.NET Core 7, Tenth Edition explains lambda →
Functional Programming in Scala, Second Edition
A function expression without a declared name, typically written using parameter and body syntax.
- How it is used
- Deploys inline function values as arguments to higher-order functions and as reusable building blocks for functional data processing.
- How deep it goes
- Defines lambda syntax, type inference, underscore shorthand, and composition, while deferring precise underscore-scoping rules to the language specification.
- Examples
- Uses findFirst predicates, array-sorting comparisons, charge coalescing, foldRight arithmetic, and underscore expressions.
- What you can do after
- Apply it via higher-order functions, predicates, folds, currying, composition, and concise Scala collection operations.
Read how Functional Programming in Scala, Second Edition explains lambda →
Grokking Simplicity
A function expression that has no name and can be defined inline where it is used.
- How it is used
- Uses short, context-specific behavior as an inline argument to higher-order functions such as map(), forEach(), and withLogging().
- How deep it goes
- Defines anonymous functions through global, local, and inline contrasts, then demonstrates callbacks; stops short of implementation internals.
- Examples
- Demonstrates logging callbacks, customer email generation, greetings, array iteration, grouping, and moving-average pipelines.
- What you can do after
- Apply it via map() and forEach() to pass one-use behavior directly where iteration or another operation consumes it.
C++ Concurrency in Action, Second Edition
A lambda expression is a C++ expression that defines an unnamed callable, optionally capturing variables from its surrounding scope.
- How it is used
- Uses lambdas to provide inline work for threads, predicates for condition-variable waits, and handlers for messages.
- How deep it goes
- Defines lambdas and illustrates practical uses, while deferring full expression details.
- Examples
- Shows thread work, a queue-nonempty wait predicate, and message handlers that update ATM state.
- What you can do after
- Apply lambda syntax to launch thread work, supply condition-variable predicates, and handle typed messages.
Read how C++ Concurrency in Action, Second Edition explains lambda →
Python How-To
The lambda keyword introduces a Python expression that defines an anonymous function.
- How it is used
- Supplies small, one-time functions for sorting keys, filtering tests, and data extraction.
- How deep it goes
- Explains syntax, expression-only bodies, calls, one-time use, and debugging trade-offs without descending into implementation internals.
- Examples
- Uses urgency-based task sorting, task filtering, absolute-value sorting, score selection, and contrasting KeyError tracebacks.
- What you can do after
- Apply it via Python sorting and filtering APIs while choosing existing or named functions when they read or debug better.
The Art of Code
A lambda is an anonymous function value that can be passed, stored, returned, or invoked as data.
- How it is used
- Expresses small pieces of behavior as values for functional interfaces, callbacks, collections, and transformations.
- How deep it goes
- Defines syntax, target typing, cross-language forms, and readability tradeoffs, but stops short of implementation internals.
- Examples
- Uses string-length predicates, returned functions, function collections, method references, loops, and Kotlin transformation chains.
- What you can do after
- Apply it via functional interfaces to pass, store, return, and invoke concise behavior while judging when explicit code reads better.
Modern C, Third Edition
An anonymous function is a function construct without a program-level name, provided by a C extension for embedding callable behavior in expressions or macros.
- How it is used
- Implements convenient generic operations inside macros by embedding callable behavior in an expression.
- How deep it goes
- Explains capture syntax, inferred const semantics, immediate invocation, and termination, but does not develop broader lambda mechanics.
- Examples
- Uses SWAP expansions that capture operand addresses and exchange their pointed-to values.
- What you can do after
- Build it from scratch as an immediately invoked lambda inside a generic macro.
.NET in Action, Second Edition
An anonymous method is a C# method implementation declared without a named method declaration and commonly represented as a delegate or function value.
- How it is used
- Supplies one-off callbacks, such as handling command-line parsing failures, without requiring a named method.
- How deep it goes
- Defines expression and statement lambdas, demonstrates delegate assignment and type inference, but does not detail generated runtime representation.
- Examples
- Compares named handlers with lambdas and demonstrates printing, string comparison, multiplication, summation, and parsing.
- What you can do after
- Apply Action and Func delegates to write inline callbacks and expression- or statement-bodied functions.
100 Java Mistakes and How to Avoid Them
A lambda expression is an anonymous Java function-like expression that provides an implementation compatible with a functional interface.
- How it is used
- Uses lambda syntax to make functional-interface arguments and overloaded target selection explicit.
- How deep it goes
- Explains parameter flow, ignored arguments, overload ambiguity, and constructor binding through focused Java examples, without runtime internals.
- Examples
- Uses Integer.sum, StringBuilder factories, map initialization, and Arrays.setAll to contrast method references with explicit lambdas.
- What you can do after
- Diagnose/debug with lambda conversion when a method reference selects an unintended overload or constructor.
Read how 100 Java Mistakes and How to Avoid Them explains lambda →
Python Workout, Second Edition
lambda is Python syntax for creating an anonymous function from parameters and a single expression.
- How it is used
- Deploys anonymous functions for one-use sorting keys and callbacks.
- How deep it goes
- Explains function objects, inline use, and readability tradeoffs, but stops short of broader lambda semantics.
- Examples
- Uses country dictionaries, string sorting, and a greeting callback to demonstrate anonymous functions.
- What you can do after
- Apply lambda to create one-use sorting keys and pass anonymous callbacks to functions.
100 Go Mistakes and How to Avoid Them
An anonymous function is a function defined without an explicit name.
- How it is used
- Uses anonymous functions to defer cleanup, configure APIs through options, and launch goroutines with captured values.
- How deep it goes
- Explains closure capture through configuration and goroutine examples, and traces deferred error propagation with named results.
- Examples
- Uses rows.Close error handling and goroutines over loop values to demonstrate practical closure behavior.
- What you can do after
- Apply anonymous functions to deferred cleanup and functional options, or avoid loop-variable capture by snapshotting or passing values.
Read how 100 Go Mistakes and How to Avoid Them explains lambda →
Build Python Web Apps with Streamlit
A lambda function is an anonymous Python function defined as a single expression, typically for short computations.
- How it is used
- Uses short anonymous functions for password validation rules and configurable dashboard metrics.
- How deep it goes
- Defines single-expression functions and demonstrates evaluation, but stops short of broader lambda mechanics.
- Examples
- Demonstrates password-rule predicates and sales or gross-margin aggregation in metric configuration.
- What you can do after
- Apply lambdas to compact validation rules and dataframe metric calculations, choosing regular functions for longer guarded logic.
Read how Build Python Web Apps with Streamlit explains lambda →
Learn Go with Pocket-Sized Projects
An anonymous function is a function value declared without a name, typically for inline or temporary use.
- How it is used
- Uses lambdas for inline sorting rules and short concurrent tasks.
- How deep it goes
- Defines lambdas, demonstrates sorting, and explains loop-variable capture, but does not develop closure internals broadly.
- Examples
- Demonstrates book sorting and concurrent maze exploration with a parameterized goroutine function.
- What you can do after
- Apply it via sort.Slice and goroutines while avoiding older Go loop-variable capture problems.
Read how Learn Go with Pocket-Sized Projects explains lambda →
ASP.NET Core in Action, 3e
A lambda expression is an anonymous function expression that can be passed or assigned as a value.
- How it is used
- Connects ASP.NET Core minimal API endpoints and middleware pipeline methods to executable behavior.
- How deep it goes
- Defines direct and assigned lambdas through working handlers, then contrasts alternatives without exploring language internals.
- Examples
- Uses fruit CRUD endpoints, an assigned get-by-id lambda, and custom middleware built with pipeline extension methods.
- What you can do after
- Apply it via ASP.NET Core minimal APIs by writing inline handlers or assigning lambdas before endpoint registration.
The Quick Python Book, Fourth Edition
A lambda expression is an anonymous function expression that evaluates to a function value and returns the value of its expression body.
- How it is used
- Uses short anonymous functions inline, especially as sort keys or dictionary values.
- How deep it goes
- Defines lambda syntax, implicit returns, and practical examples, without descending into implementation details.
- Examples
- Demonstrates word-length sorting and temperature-conversion lambdas stored in a dictionary.
- What you can do after
- Apply lambda expressions through Python's sort method or by storing and calling them as dictionary values.
Read how The Quick Python Book, Fourth Edition explains lambda →
Secrets of the JavaScript Ninja, Second Edition
A function that has no name.
- How it is used
- Defines arrow functions as a compact way to create JavaScript function values.
- How deep it goes
- Introduces ES6 arrow syntax and flags a callback-related benefit, while deferring its explanation.
- Examples
- Uses `myArg => myArg*2` to show a one-argument arrow function doubling its input.
- What you can do after
- Build a concise arrow function using the form `myArg => myArg*2`.
Read how Secrets of the JavaScript Ninja, Second Edition explains lambda →
Related concepts
- functionkind of · A function is a defined operation that maps inputs to outputs and, when implemented as a callable program unit, may also produce effects.
- higher-order functionused by · A higher-order function is a function that accepts functions as arguments, returns functions as results, or both.
- functional interfaceuses · A functional interface is an interface with exactly one abstract operation, making it compatible with implementation by a function, lambda expression, or method reference.
- to_procproduced by · to_proc is a Ruby conversion method that produces a Proc callable from an object such as a symbol.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

















