title: Pattern match on records with option type entries in OCaml
body: <p>basically I have defined a record type like this:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>and exp = Bil_t.exp = {
    var: var option;
    binop: binop option;
    load: load option;
    store: store option;
    cast: cast option;
    inte: inte option;
    let_exp: let_exp option
  }
  </code></pre>
  
  <p>And I am thinking to use a pattern match to process it, something like this:</p>
  
  <pre><code>match rexp with
      | {None;binop;None;None;None;None;None} -&gt; trans_binop @@ strip binop
      | {var;None;None;None;None;None;None} -&gt; BU.inte_to_string @@ strip @@ mark inte
      | _ -&gt; failwith "undefined"
  </code></pre>
  
  <p>Sorry for the messy code above. So basically I compile the above code, and I get the error:</p>
  
  <pre><code>Error: Syntax error
  </code></pre>
  
  <p>Could anyone give me some help on this.. I just don't know what is wrong here...</p>