From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 236FDBC32 for ; Tue, 15 Mar 2005 10:26:49 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2F9QmTi026117 for ; Tue, 15 Mar 2005 10:26:48 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA02380 for ; Tue, 15 Mar 2005 10:26:48 +0100 (MET) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2F9QlAJ026114 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 15 Mar 2005 10:26:48 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1DB8K7-0005RL-00 for ; Tue, 15 Mar 2005 09:26:47 +0000 Date: Tue, 15 Mar 2005 09:26:47 +0000 To: Caml List Subject: Re: [Caml-list] Printing values Message-ID: <20050315092647.GB19351@furbychan.cocan.org> References: <20050315042519.GA26681@anthony.ics.uci.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050315042519.GA26681@anthony.ics.uci.edu> User-Agent: Mutt/1.3.28i From: Richard Jones X-Miltered: at nez-perce with ID 4236AA58.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4236AA58.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 debugger:01 toplevel:01 cvs:01 sourceforge:01 notepad:01 wrote:01 data:02 data:02 std:02 types:02 dump:03 derived:04 formatter:05 formatter:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Mon, Mar 14, 2005 at 08:25:20PM -0800, Christian Stork wrote: > This must be a dumb question, but I couldn't find an answer. > > How can I print values of my own data types in the default way, eg, as > the debugger or the toplevel does it? Is there a standard formatter > that I can use (or generate), or do I have to write a new formatter for > each data type? One solution is to use Std.dump in Extlib[1]. It's not (AFAIAA) available in any released version of Extlib, so you'd have to use the CVS version, or use the original standalone version from which it is derived: http://merjis.com/developers/dumper Rich. [1] http://ocaml-lib.sourceforge.net/ -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com