« Return to Thread: Method Pointers

Re: Method Pointers

by Neal Gafter :: Rate this Message:

| View in Thread

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.

On Fri, Mar 23, 2012 at 6:22 PM, Ted Neward <ted@...> wrote:

> Very true! Hadn’t thought about that. I was thinking the more pedestrian
> case where Foo() will be a singular mdtoken, not the lambda case. You’re
> closer to the subject than I, Neal, but I thought I heard a C# team member
> tell me, though, that they were trying to optimize your case at the
> compiler level, so that a1 and a2 would, in fact, be considered identical,
> since the lambda used would in fact be “folded” down into a single method
> (since they contain the same contents). Not so?****
>
> ** **
>
> Ted Neward****
>
> Java, .NET, XML Services****
>
> Consulting, Teaching, Speaking, Writing****
>
> http://www.tedneward.com
>

 « Return to Thread: Method Pointers