swig/Examples/ocaml/contract/runme.ml
Zackery Spytz 8f7bc4cc10 [OCaml] Rename example_prog.ml to runme.ml in the OCaml examples
Name the output executable "runme" in the examples.
Replace use of "foolib" in the string_from_ptr example.
Fix a warning in the std_vector example.
Add strings_test to Examples/ocaml/check.list.
Disable two tests that were causing the OCaml test suite to fail.
2019-01-07 11:59:07 -07:00

12 lines
325 B
OCaml

open Swig
open Example
let _ = print_endline "This won't throw."
let _ = Printf.printf "Cos 1.0 is %f\n" (_cos '(1.0) as float)
let _ = print_endline "This will throw."
let _ =
try
Printf.printf "Cos 5.0 is %f\n" (_cos '(5.0) as float)
with Failure s ->
print_endline s ;
print_endline "Exception thrown."