So everyone (well all the IronXXX people) is doing it, so I might well too
I present using IronScheme in C# 4:
class Program
{
static dynamic Scheme = new SchemeEnvironment();
static void Main(string[] args)
{
var list = Scheme.list;
var map = Scheme.map;
var reverse = Scheme.reverse;
Func<int, int> f = x => x * x;
var r = map(f, reverse(map(f, list(1, 2, 3))));
Console.WriteLine(r.car); // prints 81
}
}
The implementation is straight forward, and can be viewed here. I just involves a simple Linq expression.
Cheers
leppie
LOL @ “static dynamic”
By: Peter Bex (sjamaan) on October 27, 2009
at 8:57 pm
I was thinking exactly the same when I wrote it.
By: leppie on October 27, 2009
at 8:59 pm
Something new about silverlight support?
By: guest on October 27, 2009
at 9:41 pm
Nope, sorry.
By: leppie on October 27, 2009
at 9:49 pm