Commit | Line | Data |
---|---|---|
34e49164 C |
1 | open Pycaml |
2 | ||
3 | let foo_bar_print = pywrap_closure (fun x -> print_endline "hi" ; pynone ()) ;; | |
4 | let sd = pyimport_getmoduledict () ;; | |
5 | let mx = pymodule_new "CamlModule" ;; | |
6 | let cd = pydict_new () ;; | |
7 | let cx = pyclass_new (pynull (), cd, pystring_fromstring "CamlClass") ;; | |
8 | let cmx = pymethod_new (foo_bar_print,(pynull ()),cx) ;; | |
9 | let _ = pydict_setitemstring (cd, "CamlMethod", cmx) ;; | |
10 | let _ = pydict_setitemstring (pymodule_getdict mx, "CamlClass", cx) ;; | |
11 | let _ = pydict_setitemstring (sd, "CamlModule", mx) ;; | |
12 | let _ = pyrun_interactiveloop (0,"-") ;; |