Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

18
  • 71
    Thanks Jon. BTW, is there something that you don't know in .NET? :) Who do you go to when you have questions? Commented Jan 9, 2009 at 16:12
  • 55
    There's always more to learn :) I've just finished reading CLR via C# - very informative. Other than that, I usually ask Marc Gravell for WCF/binding/expression trees, and Eric Lippert for C# language things. Commented Jan 9, 2009 at 16:18
  • 13
    I'd say that closures aren't useful unless they can be executed, and the "at a later time" highlights the "oddness" of being able to capture the environment (which might otherwise have gone away by execution time). If you only quote half the sentence then it's an incomplete answer, of course. Commented Jan 9, 2009 at 17:03
  • 3
    Something to add, the closure is stored as a reference, even though it's a value type. You'll see this if you play around with functions that return functions :) Commented Jun 12, 2012 at 16:26
  • 4
    @SLC: Yes, counter is available to be incremented - the compiler generates a class which contains a counter field, and any code referring to counter ends up going through an instance of that class. Commented Jun 12, 2012 at 16:40