Here's a great post about anonymous recursion in C#. He shows us how to get to a clean:
Funcfib =
Y(f => n => n > 1 ? f(n - 1) + f(n - 2) : n);
The question I'll have to ask is: as C# 3 doesn't natively support this construct, shouldn't the Y fixed-point combinator implementation be integrated into the class library?
No comments:
Post a Comment