From: Nicolas C. <war...@fr...> - 2005-02-08 09:49:09
|
> > > Anyone interested in this, http://merjis.com/developers/dumper or > > > similar functionality in extlib? My particular implementation is pure > > > OCaml. (You might want to read the "Notes" section of that page > > > first however) > > > > > > Rich. > > > > Nice ! > > Since it's not big, I don't think it needs a module of its own. Why not > > adding the to_string : 'a -> string or dump : 'a -> string value to the > > ExtLib Std module ? > > Yes, good idea. Since I don't have access to ocaml-lib CVS, do you > want to add it? The function is only about a page of code. > > I have a few ideas for extending it. For example, it would be nice to > turn on/off list understanding (although the default for lists should > probably be "on"). Something like: > > dump ~list:false ... > > If that were added, then one could also add detection and printing of > hash tables and other complex structures. I'll get round to that > later however. Well one could implement something such as : dumpf "(int,string list) Hashtbl.t" v; That would parse some type declaration and use appropriate printers. Nicolas |