Commits

Dmitry Grebeniuk  committed 4131e7e

.

  • Participants
  • Parent commits 3b3f923

Comments (0)

Files changed (1)

File src/cd_Json.ml

 ;
 
 
+value from_json_struc
+ : #uti -> Jt.t -> ubox
+ = fun uti ->
+     let rec from_json_td _uti td =
+       match td with
+       [ 
+         _ -> fun _j -> failwith
+          "from_json_struc: not implemented (on type %s)" uti#type_name
+       ]
+     in
+       from_json_td uti uti#type_desc
+;
+
 
 (* should add to and from methods both. *)
 value rec ti_add_json
      let json_from =
        match json_from with
        [ None ->
-           (* fun a -> uget_exn ti (from_json_struc *) failwith "not impl"
+           fun j -> uget_exn ti (from_json_struc ti j)
        | Some m -> m
        ]
      in
 value ti_list_add_json
  : #ti (list 'a) -> #ti 'a -> unit
  = fun ti_list_a ti_a ->
+   (
      uti_add_meth ti_list_a "json.from" &
      ubox (ti_json_from ti_list_a) &
      list_of_json
        let j_list = Br.array j in
        let a_list = List.map (from_json ti_a) j_list in
        a_list
+   )
 ;