Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the postfix numbers on F# core methods?

Tags:

f#

seq

I was looking at the source code for the Append function in the SeqModule and noticed that there are a ton of duplicate methods with @xxx postfixed to them. Does anyone know why these are here?

ILSpy Screenshot

like image 756
Joshua Belden Avatar asked Nov 29 '25 08:11

Joshua Belden


1 Answers

In short, those are the concrete classes that back various local function values, and the @xxx values indicate the source code line number that caused them to be generated (though this is an implementation detail, and the classes could be given any arbitrary name).

Likewise, the C# compiler uses a conceptually similar scheme when defining classes to implement anonymous delegates, iterator state machines, etc. (see Eric Lippert's answer here for how the "magic names" in C# work).

These schemes are necessary because not every language feature maps perfectly to things that can be expressed cleanly in the CLR.

like image 94
kvb Avatar answered Dec 01 '25 11:12

kvb