/tags/rel-1-3-15/SWIG/Examples/ocaml/simple/example_prog.ml
# · OCaml · 30 lines · 8 code · 16 blank · 6 comment · 0 complexity · dd5577cc262cc2cdd4b349b06dbaf35b MD5 · raw file
- (* example_prog.ml *)
- open Example
- (* Call our gcd() function *)
- let x = 42
- let y = 105
- let g = gcd x y
- let _ = Printf.printf "The gcd of %d and %d is %d\n" x y g
- (* Manipulate the Foo global variable *)
- (* Output its current value *)
- let _ = Printf.printf "Foo = %f\n" (_Foo_get ())
- (* Change its value *)
- let _ = _Foo_set 3.1415926
- (* See if the change took effect *)
- let _ = Printf.printf "Foo = %f\n" (_Foo_get ())