/tags/rel-1.3.35/Examples/test-suite/ocaml/typename_runme.ml
OCaml | 12 lines | 8 code | 3 blank | 1 comment | 0 complexity | cff61cf98804ea72ca5916ec3816746a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1(* Fun with type names -- stolen from the ruby runme *)
2
3open Swig
4open Typename
5
6let f = new_Foo C_void
7let b = new_Bar C_void
8
9let x = _twoFoo f
10let _ = match x with C_double f -> () | _ -> raise (Failure "not a float")
11let y = _twoBar b
12let _ = match y with C_int i -> () | _ -> raise (Failure "not an int")