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