Search code examples
f#quotations

F# special quotes? (##)


I just ran across http://frankniemeyer.blogspot.com/2010/04/minimalistic-native-64-bit-array.html Which contains the line

(# "sizeof !0" type('T) : nativeint #)

I believe the technical phrase is "what the heck?" I have never in my (~8 months) of F# programming run across something even resembling that...

FSI tells me something about deprecated constructs, used only for F# libs...

And google with (# does uh...well, not much

Any direction in this?


Solution

  • This is the notation for inline IL emission. It used to be a more prominent feature during F#'s earlier years, but has been deprecated. A gentleman named Brian from the F# team has indicated that it is currently used mainly to bootstrap the F# compiler, and that the team had intended to mark this construct as an error, not merely a warning.

    See his post here for the full story.