If I pass lazy expressions or delegates to as arguments to functions, what happens with variables mentioned in the lazy expression or in the delegate body if those variables are on the stack or otherwise out of scope, or are objects that may be freed? Does the compiler partially protect the programmer from mistakes here?
If anyone can comment on how these features are implemented in generated code wrt stack-allocated objects that are _in_ lexical scope in a delegate evaluation context, then I'd be interested to hear about this.
