For a person without a comp-sci background, what is a lambda in the world of Computer Science?
相关问题
- Why wrapping a function into a lambda potentially
- Generating powerset in one function, no explicit r
- Check if tie in count of lists using linq
- C# to VB - How do I convert this anonymous method
- applying a list to an entered function to check fo
相关文章
- Why doesn't C11 support lambda functions
- Algorithm for partially filling a polygonal mesh
- Should client-server code be written in one “proje
- Algorithm for maximizing coverage of rectangular a
- Is there an existing solution for these particular
- Will java allow to use functional interfaces as me
- Detect if C++ lambda can be converted to function
- What is Scope Creep? [closed]
In Javascript, for example, functions are treated as the same mixed type as everything else (
int
,string
,float
,bool
). As such, you can create functions on the fly, assign them to things, and call them back later. It's useful but, not something you want to over use or you'll confuse everyone who has to maintain your code after you...This is some code I was playing with to see how deep this rabbit hole goes:
You can think of it as an anonymous function - here's some more info: Wikipedia - Anonymous Function
In context of CS a lambda function is an abstract mathematical concept that tackles a problem of symbolic evaluation of mathematical expressions. In that context a lambda function is the same as a lambda term.
But in programming languages it's something different. It's a piece of code that is declared "in place", and that can be passed around as a "first-class citizen". This concept appeared to be useful so that it came into almost all popular modern programming languages (see lambda functions everwhere post).