I suggest we ...

Make reflected definitions easy to access

Given a reflected function like this:

[<ReflectedDefinition(true)>]
let foo (x) = ...

I would like to be able to get the reflected definition like this:
foo.TryGetReflectedDefinition()

instead of ugly code like this (note how I had to write the method name as a string):

let fooType = foo.GetType().DeclaringType.GetMethod("foo")

let fooExpr = Expr.TryGetReflectedDefinition(fooType)

3 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
zjv shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Don Syme commented  ·   ·  Flag as inappropriate

    Using a quotation <@ foo @> will make it easier to accurately get the method name.

    I will decline this: the existing mechanism seems good enough considering this is relatively rare.

F# Language

Feedback and Knowledge Base