Microsoft MVP Patrick Smacchia shows how the new C# version 2 anonymous method functionality works and how it can be used. This language enhancement is implemented solely via the compiler and doesn't require changes in the IL. Of particular importance is the ability to use local variables within anonymous methods.
In the article, Patrick shows how variables and members from outside the anonymous method can be accessed based on their signatures. He then goes on to compare the anonymous methods functionality to that of closures.
|