ALERT

[WEBINAR] See the Whole Story: The Case for a Visualization Platform

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.

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
Tweat cdn.techopedia.com
"Techopedia" on Twitter


'@Techopedia'
Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Resources
Free Whitepaper: The Path to Hybrid Cloud
Free Whitepaper: The Path to Hybrid Cloud:
The Path to Hybrid Cloud: Intelligent Bursting To Amazon Web Services & Microsoft Azure
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.