Can you help me understand this example of fibonacci using C# closures?
<p>Attempting to learn functional C#, I ported Dustin Campbell's <a href="http://diditwith.net/PermaLink,guid,f3be3915-873b-4082-a087-871f5dd52c82.aspx" rel="nofollow">fibonacci example</a> to C#3. My solution works but I have trouble understanding the last line of Nth_Fib. Isn't it weird that the agrument to formula doesn't matter? n gets instantly bound in the expression "fn => Nth_Fib(n - 1) + Nth_Fib(n - 2)" but I can't change the return type of build to Func&lt;int&gt;. This means I have to pass a redundant argument later?</p>

<p>note: the test passes</p>

<pre><code>[TestFixture]
public class TestFibClosure{
    [Test]
    public void test_fib(){
        Assert.AreEqual(8, new FibClosure().Nth_Fib(5));
        Assert.AreEqual(1597, new FibClosure().Nth_Fib(16));
    }
}

public class FibClosure{
    private Func&lt;int, int&gt;[] formulaCache;

    public int Nth_Fib(int n){
        if (n &lt;= 2) return n;
        if(formulaCache == null) formulaCache = new Func&lt;int, int&gt;[(n + 1)];
        Func&lt;int, int&gt; formula = build(n);
        //doesn't matter, n is already bound !! ??
        return formula(334567);//same as formula(n)
    }

    private Func&lt;int, int&gt; build(int n){
        if (formulaCache[n] == null)
            formulaCache[n] = (fn =&gt; Nth_Fib(n - 1) + Nth_Fib(n - 2));
        return formulaCache[n];
    }
}
</code></pre>
