csharp notes - 3

1. A lambda expression is an unnamed method written in place of a delegate instance

The compiler immediately converts the lambda expression to either:

  • A delegate instance

  • An expression tree, of type Expression<T>, representing the code inside the lambda expression in a traversable object model. This allows the lambda expression to be interpreted later at runtime .

2. A lambda expression has the following BNF form:

(parameters) => expression-or-statement-block
Each parameter of the lambda expression corresponds to a delegate parameter, and the type of the expression (which may be void) corresponds to the return type of the delegate
3. Extension methods allow an existing type to be extended with new methods without altering the definition of the original type
 

posted on 2010-04-07 16:31  逗号李  阅读(192)  评论(0编辑  收藏  举报

导航