title: Pattern matching in scala, check if number greater than
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1585395/using-comparison-operators-in-scalas-pattern-matching-system">Using comparison operators in Scala’s pattern matching system</a>  </p>
  </blockquote>
  
  
  
  <p>For below method I receive an error : "'=>' expected but integer literal found."</p>
  
  <p>Is it not possible to check if x is greater than another number and or is there an alternative approach to return "greater than 2" if '> 2' is matched ? </p>
  
  <pre><code> def describe(x: Any) = x match {
      case 5 =&gt; "five"
      case &gt; 2 =&gt; "greater than 2"
    }
  </code></pre>