C#3.0/LINQ的新下載

gudesheng發表於2008-01-03

原文: New drop of C# 3.0/LINQ

下載地址:http://www.microsoft.com/downloads/details.aspx?familyid=1e902c21-340c-4d13-9f04-70eb5e3dceea&displaylang=en

我喜歡它的這一特色:LambdaExpression.Compile

Expression> expr = a => a + 3;
Console.WriteLine(expr); // prints "a => Add(a, 3)"
Func func = expr.Compile(); // LCG's an MSIL method from the expr
Console.WriteLine(func(4)); // prints "7"
這些程式碼等同於
(define expr '(lambda (a) (+ a 3)))
(display expr)
(define func (eval expr (scheme-report-environment 5)))
(display (func 4))


Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1438370


相關文章