Yet another Hello World 30 Jan 2008


Statue
using System;
using System.Linq.Expressions;

class HelloWorldOfTrees {

	static void Main ()
	{
		var param = Expression.Parameter (typeof (string), "p");

		var cwl = Expression.Lambda> (
			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).