Yet another Hello World
using System;
using System.Linq.Expressions;
class HelloWorldOfTrees {
static void Main ()
{
var param = Expression.Parameter (typeof (string), "p");
var cwl = Expression.Lambda<Action<string>> (
Expression.Call (
typeof (Console).GetMethod (
"WriteLine", new [] { typeof (string) }),
param), param).Compile ();
cwl ("Hello World !");
}
}
[mono] /tmp @ gmcs test.cs [mono] /tmp @ mono test.exe Hello World !
Well heh, you can’t do really much more than that, but at least, that is working (sort of).
Trackbacks
Use the following link to trackback from your own site:
http://evain.net/blog/articles/trackback/470

