问题:
I am looking at the new implementations in C# 7.0 and I find it interesting that they have implemented local functions but I cannot imagine a scenario where a local function would be preferred over a lambda expression, and what is the difference between the two.我正在查看C# 7.0中的新实现,我发现它们实现了局部函数很有趣,但我无法想象局部函数比 lambda 表达式更受欢迎的场景,以及两者之间的区别是什么。
I do understand that lambdas are anonymous
functions meanwhile local functions are not, but I can't figure out a real world scenario, where local function has advantages over lambda expressions我知道 lambda 是anonymous
函数,而本地函数不是,但我无法弄清楚一个真实的场景,其中本地函数比 lambda 表达式有优势
Any example would be much appreciated.任何例子将不胜感激。 Thanks.谢谢。
解决方案:
参考一: https://en.stackoom.com/question/2lnAr参考二: https://stackoom.com/question/2lnAr