title: How do I 'dereference' a closure?
body: <p>So I'm parsing an expression tree, but I've come across an anomaly. Given the expression:</p>
  
  <pre><code>Int32 five = 5;
  
  var query = Z&lt;MyPersonTable&gt;.QueryVia&lt;IPersonQuery&gt;()
      .Where(person =&gt; five == 5);
  </code></pre>
  
  <p>When I parse the <code>five</code> field, rather than getting an actual number, I get:</p>
  
  <p><code>Program.Hosting.TestService.P+&lt;&gt;;c__DisplayClass0</code></p>
  
  <p>which I recognize must be a closure, but how do I get the actual value out of it?</p>
  
  <p>Here's my parser:</p>
  
  <pre><code>    private static XElement Parse(ConstantExpression constant)
      {
          return new XElement("CONSTANT",
              new XAttribute("TYPE", constant.Type),
                  constant.Value);
      }
  </code></pre>
  
  <p>which normally works for other values, but not when I pass in a closure.</p>