File: ocamlobj.ml

package info (click to toggle)
pycaml 0.82-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 572 kB
  • ctags: 430
  • sloc: ansic: 962; ml: 409; makefile: 104; python: 4
file content (12 lines) | stat: -rw-r--r-- 548 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
open Pycaml

let foo_bar_print = pywrap_closure (fun x -> print_endline "hi" ; pynone ()) ;;
let sd = pyimport_getmoduledict () ;;
let mx = pymodule_new "CamlModule" ;;
let cd = pydict_new () ;;
let cx = pyclass_new (pynull (), cd, pystring_fromstring "CamlClass") ;;
let cmx = pymethod_new (foo_bar_print,(pynull ()),cx) ;;
let _ = pydict_setitemstring (cd, "CamlMethod", cmx) ;;
let _ = pydict_setitemstring (pymodule_getdict mx, "CamlClass", cx) ;;
let _ = pydict_setitemstring (sd, "CamlModule", mx) ;;
let _ = pyrun_interactiveloop (0,"-") ;;