Replying to my own question, judging by what I see in ildasm it looks as if this is some way of distinguishing overloaded functions. Apparently the 158 must just be a coincidence. I'd still like to see more discussion of this if anyone knows of a bit more technical detail on this particular subject.

By on 4/16/2010 10:39 AM ()

I don't have any inside information, but here's my best guess. Essentially any F# function value of type 'a->'b will be represented in IL by a separate class deriving from FSharpFunc<'a,'b>. These classes are automatically generated during the compilation process, and appear to be given names of the form name@num1 followed by an optional -num2, where name is the name of the enclosing syntactic construct, num1 is the source file's line number, and num2 is some sort of uniquefier. The stack frame that you have highlighted is calling the Invoke method on an object of such a class, which corresponds to calling a first class function in the source code file.

I suspect that you should not rely on this particular code generation scheme, since it's a compiler detail and is not covered by any sort of public spec AFAIK.

By on 4/16/2010 10:58 AM ()

I expect you're probably on the right track, kvb.

As far as relying on that code generation scheme--well, I'm just trying to understand what the debugger is telling me a bit better and I found the syntax a little bit confusing so I thought I'd ask.

By on 4/19/2010 6:09 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper