When are variables a part of a closure?
<p>Say I wanted to make an anonymous getter function that would return the current value of a member variable foo. I might write:</p>

<pre><code>Func&lt;int&gt; myFunction = delegate() { return foo; };
</code></pre>

<p>But say I wanted a function that takes the value of foo, binds that value into its closure, and then returns that value every time it's called. I'd write the same thing:</p>

<pre><code>Func&lt;int&gt; myFunction = delegate() { return foo; };
</code></pre>

<p>How does the C# compiler tell the difference? Is there any way to be more specific in asking what you want?</p>
