title: how to raise exception in the ocaml code?
body: <p><code>bigint</code> as data type of the form (sign, base, integer list) like 35 in base of 7 is 
  (Pos, 7, [0;5]).
  now we need to convert this bigint to integer that is if we put <code>(Pos, 7, [0;5])</code> then we get answer as 35. i dont understand that  how to raise exception on the cases that no. in list are greater than base or base is 0 or most significant digit is zero -> [7;3;4;0].
  thus i wrote:</p>
  
  <pre><code>#type sign = Pos | Neg;;
  #type digitseq = int list;;
  #type bigint = sign * int * digitseq;;
  #let check_bigint (sign, r, l1) = match l1 with
      [] -&gt; true
    | [0] -&gt; false
    | x::xs -&gt; if (x &gt;= r) then false else check_bigint (sign, r, xs)
  ;;
  #let rec bigint2int (sign, r, l1) =
    if (check_bigint (sign, r, l1) = false) then
      raise exception Invalid_input
    else
      (match l1 with
         [] -&gt; 0
       | x::xs -&gt; if (sign = Pos) then
                    x+r*(bigint2int (sign, r, xs))
                  else (-x)+r*(bigint2int (sign, r, xs)))
  ;;
  </code></pre>
  
  <p>i am getting a syntax error in else just before (match l1...
  please tell whats wrong.</p>