Commits

Dmitry Grebeniuk committed 0025082

doc

  • Participants
  • Parent commits 382a2e3

Comments (0)

Files changed (4)

 ^_build/
 ^log$
 ^dyntest.(exe|byte|native)$
+^dynvar.docdir
-ocamlbuild dyntest.native
+ocamlbuild dyntest.native dynvar.docdir/index.html
+(** Dynamically typed variables *)
+
+(** Exception [Type_error (value_type, used_with_type)] is
+    raised by [get] if you are trying to get the value of
+    wrong type.
+*)
 exception Type_error of (string * string)
 ;
 
+(** Type of the value that represents the type of dynamic variable *)
 type ty 'a;
+
+(** Type of dynamic variable *)
 type var;
 
+(** [mktype typename] creates a value that represents the type of
+    dynamic variables you can create.  (i.e. it's the witness
+    of dynamic variable's type)
+ *)
 value mktype : string -> ty 'a
 ;
 
+(** [var ty val] creates dynamic variable with type [ty]
+    and value [val].  The success of this operation is guaranteed
+    by OCaml's type system.
+*)
 value var : ty 'a -> 'a -> var
 ;
 
+(** [get ty var] gets the value of dynamic variable [var]
+    which should be created by [var ty val] with the same [ty].
+    (same == "physically equal").
+    @raise Type_error when types differ.
+*)
 value get : ty 'a -> var -> 'a
 ;

File dynvar.odocl

+Dynvar