English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Dum: dumper module with cycle detection
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-09-22 (21:02)
From: Martin Jambon <martin@w...>
Subject: Dum: dumper module with cycle detection
Hi list,

Wink.com is releasing a module called Dum for dumping data.
It derives from Dumper by Richard W Jones (now Std.dump in Extlib) and
from Size by Jean-Christophe Filliatre.


The main improvement over the original Dumper is that shared values 
and therefore cycles are detected and labelled:

# let rec loopy = 1 :: 2 :: loopy in Dum.p loopy;;
- : string = "#0: (1 (2 #0))"

Dum was originally developed to print the maximum out of uncaught 
exceptions, since the standard Printexc.to_string does not go arbitrarily 
deep and this was occasionally a source of frustration.

Now data such as closure fields and object fields are dumped like regular 
data without causing particular problems or worries.

The output is pretty-printed and its size limit is configurable.


Martin, for Wink.