PageRenderTime 24ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1(* example_prog.ml *)
 2
 3open Example
 4
 5(* Call our gcd() function *)
 6
 7let x = 42
 8let y = 105
 9let g = gcd x y
10let _ = Printf.printf "The gcd of %d and %d is %d\n" x y g
11
12(* Manipulate the Foo global variable *)
13
14(* Output its current value *)
15let _ = Printf.printf "Foo = %f\n" (_Foo_get ())
16
17(* Change its value *)
18let _ = _Foo_set 3.1415926
19
20(* See if the change took effect *)
21let _ = Printf.printf "Foo = %f\n" (_Foo_get ())
22
23
24
25
26
27
28
29
30