diff options
| author | Pierre-Marie Pédrot | 2019-12-12 18:36:03 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2019-12-22 14:03:06 +0100 |
| commit | 1de15982dceaf28740f49f1d6cba61a5473656b0 (patch) | |
| tree | e2fef8a399f1fd1279acce59b5e42d15238479f4 /library/libobject.ml | |
| parent | 9c75b6a6582620e2fb9a39c1ea1aa46a321af6a7 (diff) | |
Export the dynamic type API of libobjects.
Diffstat (limited to 'library/libobject.ml')
| -rw-r--r-- | library/libobject.ml | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/library/libobject.ml b/library/libobject.ml index c9ea6bcff8..54c23ff2d5 100644 --- a/library/libobject.ml +++ b/library/libobject.ml @@ -92,14 +92,12 @@ let declare_object_full odecl = let na = odecl.object_name in let tag = Dyn.create na in let () = cache_tab := DynMap.add tag odecl !cache_tab in - let infun v = Dyn.Dyn (tag, v) in - let outfun v = match Dyn.Easy.prj v tag with - | None -> assert false - | Some v -> v - in - (infun,outfun) + tag -let declare_object odecl = fst (declare_object_full odecl) +let declare_object odecl = + let tag = declare_object_full odecl in + let infun v = Dyn.Dyn (tag, v) in + infun let cache_object (sp, Dyn.Dyn (tag, v)) = let decl = DynMap.find tag !cache_tab in |
