Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / pycaml / tupletest.ml
CommitLineData
34e49164
C
1open Pycaml
2
3let foo_bar_print = pywrap_closure
4 (fun x -> pytuple_fromarray (pytuple_toarray x)) ;;
5let sd = pyimport_getmoduledict () ;;
6let mx = pymodule_new "CamlModule" ;;
7let cd = pydict_new () ;;
8let cx = pyclass_new (pynull (), cd, pystring_fromstring "CamlClass") ;;
9let cmx = pymethod_new (foo_bar_print,(pynull ()),cx) ;;
10let _ = pydict_setitemstring (cd, "CamlMethod", cmx) ;;
11let _ = pydict_setitemstring (pymodule_getdict mx, "CamlClass", cx) ;;
12let _ = pydict_setitemstring (sd, "CamlModule", mx) ;;
13let _ = pyrun_simplestring
14 ("from CamlModule import CamlClass\n" ^
15 "x = CamlClass()\n" ^
16 "for i in range(100000):\n" ^
17 " x.CamlMethod(1,2,3,4)\n")