externals.ml 369 Bytes
Newer Older
1
type ext_info
2

3
let has_ext = ref false
4

5
let register = 
6
  ref (fun _ _ _ -> 
7
	 Cduce_loc.raise_generic "No built-in support for ocaml externals")
8

9 10 11
let ext_info =
  ref (fun () -> assert false)

12
let resolve s args =
13 14 15 16 17
  has_ext := true;
  !register true s args

let typ s args =
  snd (!register false s args)
18 19


20
let get () = if !has_ext then Some (!ext_info ()) else None