我喜欢它的这一特色:LambdaExpression.Compile


Expression<Func<int, int>> expr = a => a + 3;


Console.WriteLine(expr); // prints "a => Add(a, 3)"


Func<int, int> 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))