What is a Lambda?

后端 未结 7 1743
傲寒
傲寒 2020-11-28 21:53

Could someone provide a good description of what a Lambda is? We have a tag for them and they\'re on the secrets of C# question, but I have yet to find a good definition an

7条回答
  •  萌比男神i
    2020-11-28 22:43

    It's just an anonymous function declared inline, most typically assigned to a delegate when you don't want to write a full-fledged function.

    In languages like lisp/scheme, they're often passed around quite liberally as function parameters, but the idiom in C# typically finds lambdas used only for lazy evaluation of functions, as in linq, or for making event-handling code a bit terser.

提交回复
热议问题