<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -26,10 +26,10 @@ CAMLDEP=../boot/ocamlrun ../tools/ocamldep
 
 OBJS=pervasives.cmo $(OTHERS)
 OTHERS=enum.cmo bitSet.cmo array.cmo list.cmo char.cmo string.cmo sys.cmo \
-  hashtbl.cmo sort.cmo marshal.cmo obj.cmo \
+  sort.cmo marshal.cmo obj.cmo buffer.cmo hashtbl.cmo \
   int32.cmo int64.cmo nativeint.cmo \
   lexing.cmo parsing.cmo \
-  set.cmo map.cmo stack.cmo queue.cmo stream.cmo buffer.cmo \
+  set.cmo map.cmo stack.cmo queue.cmo stream.cmo \
   printf.cmo format.cmo scanf.cmo \
   arg.cmo printexc.cmo gc.cmo \
   digest.cmo random.cmo callback.cmo \</diff>
      <filename>stdlib/Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -162,6 +162,16 @@ let fold f h init =
   done;
   !accu
 
+let dump ht = 
+  let b = Buffer.create (5 * length ht) in
+  let add s = Buffer.add_string b s in
+  let add_entry k d = 
+    add &quot;( &quot;; add (Obj.dump k); add &quot;=&gt; &quot;; add (Obj.dump d); add &quot; ) &quot; in
+  iter add_entry ht;
+  Buffer.contents b
+
+let print ht = print_endline (dump ht)
+
 (* Functorial interface *)
 
 module type HashedType =</diff>
      <filename>stdlib/hashtbl.ml</filename>
    </modified>
    <modified>
      <diff>@@ -97,6 +97,12 @@ val length : ('a, 'b) t -&gt; int
    Multiple bindings are counted multiply, so [Hashtbl.length]
    gives the number of times [Hashtbl.iter] calls its first argument. *)
 
+val dump : ('a, 'b) t -&gt; string
+(** [Hashtbl.dump tbl] dumps the contents of the hashtbl to a string,
+    a bit more intelligently than just Obj.dump on the hashtbl. *)
+
+val print : ('a, 'b) t -&gt; unit
+(** As Obj.print, only more appropriate for the hashtbl *)
 
 (** {6 Functorial interface} *)
 </diff>
      <filename>stdlib/hashtbl.mli</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3f94164c4323d9dda600ab427664284d54e593a1</id>
    </parent>
  </parents>
  <author>
    <name>Eric Norige</name>
    <email>thelema314@gmail.com</email>
  </author>
  <url>http://github.com/thelema/ocaml-community/commit/4c1fde6204047ee327a61c527925f26d00d837a4</url>
  <id>4c1fde6204047ee327a61c527925f26d00d837a4</id>
  <committed-date>2008-04-13T11:26:41-07:00</committed-date>
  <authored-date>2008-04-13T11:26:41-07:00</authored-date>
  <message>Reorder dependencies in stdlib/Makefile to enable a nice Hashtbl.{dump,print} functions</message>
  <tree>71ae94bc62fa776e4d34a65b3964b34889d241ac</tree>
  <committer>
    <name>Eric Norige</name>
    <email>thelema314@gmail.com</email>
  </committer>
</commit>
