title: Erlang matchspecs with tuple comparison
body: <p>I want to use <code>erlang datetime</code> values in the standard format <code>{{Y,M,D},{H,Min,Sec}}</code> in a <code>MNESIA table</code> for logging purposes and be able to select log entries by comparing with constant start and end time tuples.</p>
  
  <p>It seems that the matchspec guard compiler somehow confuses tuple values with guard sub-expressions. Evaluating <code>ets:match_spec_compile(MatchSpec)</code> fails for </p>
  
  <pre><code>MatchSpec = [
  {
  {'_','$1','$2'}
  ,
  [
  {'==','$2',{1,2}}
  ]
  ,
  ['$_']
  }
  ]
  </code></pre>
  
  <p>but succeeds when I compare <code>$2</code> with any non-tuple value.</p>
  
  <p>Is there a restriction that match guards cannot compare tuple values?</p>