[WEBINAR] Bulletproof: How Today's Business Leaders Stay on Top

Lambda Expression

Definition - What does Lambda Expression mean?

A lambda expression is an anonymous function that provides a concise and functional syntax, which is used to write anonymous methods. It is based on the function programming concept and used to create delegates or expression tree types. The syntax is function(arg1, arg2...argn) expression.

Techopedia explains Lambda Expression

Lambda expressions use the operator symbol =, which reads as "goes to." Input parameters are specified on the operator's left side, and statement/expressions are specified on the right. Generally, lambda expressions are not directly used in query syntax but are often used in method calls. Query expressions may contain method calls.

Lambda expression syntax features are as follows:

  • It is a function without a name.
  • There are no modifiers, such as overloads and overrides.
  • The body of the function should contain an expression, rather than a statement.
  • May contain a call to a function procedure but cannot contain a call to a subprocedure.
  • The return statement does not exist.
  • The value returned by the function is only the value of the expression contained in the function body.
  • The End function statement does not exist.
  • The parameters must have specified data types or be inferred.
  • Does not allow generic parameters.
  • Does not allow optional and ParamArray parameters.

Lambda expressions provide shorthand for the compiler, allowing it to emit methods assigned to delegates. The compiler performs automatic type inference on the lambda arguments, which is a key advantage.

Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.