senthilkumar senthilkumar

Niner since 2005


  • Luke Hoban: Orcas - Compiling LINQ, C# Futures, Intellisense

    Apart from type inference of parameters, what do lamba functions add to anonymous methods? In the example Luke showed on the whiteboard, instead of generating array.Select( i => i*i), the compiler could have generated  array.Select(delegate (int i) { return i*i;} );. Of course, it would have to know at that point that i is an int, but it would have to know about it eventually, even with lambda functions. I guess it makes the compiler design simpler to do it in two separate steps?