Method parameters is declaring as lambda parameters
Below statement declare parameterless method called Print.
AddMethod(MemberAttributes.Public | MemberAttributes.Static, ()=>"Print",...
Below statement declare method Print with two parameters - i type of int and s type of string.
AddMethod(MemberAttributes.Public | MemberAttributes.Static, (int i, string s)=>"Print",...
Here is we print the value of those parameters.
AddMethod(MemberAttributes.Public | MemberAttributes.Static, (int i, string s)=>"Print",
   Emit.stmt((int i, string s)=>Console.WriteLine("i={0}, s={1}", i, s))
)
In above example stmt method accept lambda function with two params - i and s, which is reference to Print method parameters.

Last edited May 16, 2009 at 7:47 AM by AlexShirshov, version 4

Comments

No comments yet.