Method Pointers

Neal Gafter neal at
Sun Mar 25 11:11:46 PDT 2012

On Sun, Mar 25, 2012 at 10:20 AM, Ben Evans
<benjamin.john.evans at>wrote:

> OK, I'll bite.
> On Sun, Mar 25, 2012 at 2:23 AM, Neal Gafter <neal at> wrote:
> > The C# compiler goes to a tiny bit of trouble to make it so that in some
> > cases when you evaluate the very same lambda expression twice (not
> written
> > twice, but written once and evaluated twice) you get the same object.
>  But
> > you can't rely on it.
> Um, why?

What is your question?  Why does it do that, or why can't you rely on it?

> What's the rationale for having a feature which only works some of the
> time, and
> furthermore seems to only work in cases that overlap a lot with "cases
> beginners
> would try out, and then draw entirely wrong conclusions from"?

The "feature" is to generate more compact or efficient code when it is easy
to do so.  We do that because it improves the performance of programs
written by our customers.  Solving the general problem is not possible,
which is why we don't always collapse equivalent lambdas.


More information about the lambda-dev mailing list