From ef312564ca84a2b49fc291434d8fb2f8501bb618 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 15 Nov 2016 13:00:01 +0100 Subject: Initial commit --- catalog.ml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 catalog.ml (limited to 'catalog.ml') 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 + + -- cgit v1.2.3