Commits

Dmitry Grebeniuk  committed 25ef118

ti_sum_type: + ~type_name

  • Participants
  • Parent commits 9d27970

Comments (0)

Files changed (1)

 
 class ti_sum_type ['a]
   ?cmp ?eq ?hash ?show
+  ?type_name
   ?(constr = [| |])
   (destr : ('a -> (variant_name * (meth_name -> array ubox))))
  =
     ;
 
     value mutable v_type_desc = Simple "<not_inited>";
+(*
+    value mutable v_type_name = "(some sum_type)";
+*)
     initializer
       (v_type_desc :=
          Sum_type
               )
               constr
            )
+      ;
+       match type_name with
+       [ None -> ()
+       | Some n -> v_type_name.val := Some n
+       ]
       )
     ;