Version française
Home     About     Download     Resources     Contact us    
Browse thread
Why doesn't ocamlopt detect a missing ; after failwith statement?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Why doesn't ocamlopt detect a missing ; after failwith statement?

--------------------------------------------------------------- t.ml --
let () =
  if false then
    failwith "Failed ..." (* ; *)
  prerr_endline "OK"
----------------------------------------------------------------------

Compiled with ocamlopt.opt:

$ ocamlopt.opt t.ml
$ ./a.out 
$

(it prints nothing).  If I uncomment/add the ';', then it prints the
OK message:

$ ocamlopt.opt t.ml
$ ./a.out 
OK

All well and good, but I don't understand why it doesn't warn me about
the missing ';' in the first case.

Rich.

-- 
Richard Jones.  http://www.annexia.org/  http://www.j-london.com/
>>>   http://www.team-notepad.com/ - collaboration tools for teams   <<<
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
http://execellence.co.uk/ - Interim and executive recruitment