title: How to get a name of a variable coming into a function as a parameter using F#?
body: <p>Is there any way in F# how to get a name of a variable passed into a function?</p>
  
  <p>Example:</p>
  
  <pre><code>let velocity = 5
  let fn v = v.ParentName
  let name = fn velocity // this would return "velocity" as a string
  </code></pre>
  
  <p>Thank you in advance</p>
  
  <p>EDIT:</p>
  
  <p>Why this code does not work? It is matched as value, so I can not retrieve the "variable" name.</p>
  
  <pre><code>type Test() =
    let getName (e:Quotations.Expr) =
      match e with
        | Quotations.Patterns.PropertyGet (_, pi, _) -&gt; pi.Name + " property"
        | Quotations.Patterns.Value(a) -&gt; failwith "Value matched"
        | _ -&gt; failwith "other matched"
    member x.plot v = v |&gt; getName |&gt; printfn "%s"
  
  let o = new Test()
  
  let display () =
    let variable = 5.
    o.plot &lt;@ variable @&gt;
  
  let runTheCode fn = fn()
  
  runTheCode display
  </code></pre>