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
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    zjv shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      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