diff options
Diffstat (limited to 'catalog.ml')
-rwxr-xr-x | catalog.ml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/catalog.ml b/catalog.ml new file mode 100755 index 0000000..ee74a5a --- /dev/null +++ b/catalog.ml @@ -0,0 +1,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
+
+
|