Commits

Anonymous committed 978d1ed

printing binary done

Comments (0)

Files changed (2)

 exception Not_supported;;
 exception Unknown_type;;
 
-let print_binary bin = 
-  print_endline "------------------------------";;
-  (*
+let print_bin bin = 
   let rec print_ n =
     if n < String.length bin then begin 
-      print_int (int_of_char (String.get bin n));
+      Printf.printf "%.2X " (int_of_char (String.get bin n));
       print_ (n+1);
     end else 
-      print_endline " ahoge  .. "
+      print_endline ""
   in
-    print_ 0;; *)
+    print_string "binary: ";
+    print_ 0;;
 
 let make_small_bigint bin len =
   let rec make_small_bigint_ i prod v = 
   in
   let bin = load_file filename in
   let result = Bert.decode_binary bin in
-    Bert.print_binary bin;
     Printf.printf "reading %s: \n" filename;
     begin match result with
       | Bert.Ok(term, remain)->
+	  Bert.print_bin bin;
 	  Bert.print_erlterm term;
 	  print_endline "\n==all read.";
       | _->