title: How to use assert in OCaml?
body: <p>I am trying to learn OCaml and I am having trouble with the assertion statement. In the interpreter I can use it:</p>
  
  <pre><code>Zameers-MacBook-Air:~ zmanji$ ocaml
          OCaml version 4.01.0
  
  # let x = 1;;
  val x : int = 1
  # assert(x &gt; 2);;
  Exception: Assert_failure ("//toplevel//", 1, 0).
  # ^D
  </code></pre>
  
  <p>However when I put the code in a file that looks like this:</p>
  
  <pre><code>let x = 1
  assert(x &gt; 2)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Zameers-MacBook-Air:Q4 zmanji$ ocaml test.ml
  File "test.ml", line 2, characters 0-6:
  Error: Syntax error
  </code></pre>
  
  <p>What am I doing wrong?</p>