diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2016-11-15 13:00:01 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2016-11-15 13:00:01 +0100 |
commit | ef312564ca84a2b49fc291434d8fb2f8501bb618 (patch) | |
tree | 79415fcf225e6da1042c8edaae5e4a74c7a983cb /catalog.ml |
Initial commit
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
+
+
|