aboutsummaryrefslogtreecommitdiff
path: root/catalog.ml
blob: ee74a5a43fbea9b616d90f5d527a5a4b31387784 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(** Catalog for all function *)
module C = Map.Make(
  struct
    type t = UTF8.t
    let compare a b = Pervasives.compare
        (String.uppercase_ascii @@ UTF8.to_utf8string a)
        (String.uppercase_ascii @@ UTF8.to_utf8string b)
  end
)

let catalog = ref C.empty

let register name f =
  catalog := C.add name f !catalog

let eval name params =

  let func = C.find name !catalog in
  func params