From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 2B34DD460 for ; Sun, 6 Nov 2005 22:11:54 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA6LBrQ5019079 for ; Sun, 6 Nov 2005 22:11:53 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA13820 for ; Sun, 6 Nov 2005 22:11:52 +0100 (MET) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA6LBpKi019073 for ; Sun, 6 Nov 2005 22:11:52 +0100 Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id 296A8CD9952; Sun, 6 Nov 2005 16:11:50 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.151]) by frontend1.internal (MEProxy); Sun, 06 Nov 2005 16:11:50 -0500 X-Sasl-enc: eFFx9txRdtU1AMWdlgYM+VGr08RdJ6v/Ud2eVsqHAfS6 1131311506 Received: from [172.16.13.137] (burnham.ljcrf.edu [192.231.106.2]) by frontend2.messagingengine.com (Postfix) with ESMTP id 881B75703A9; Sun, 6 Nov 2005 16:11:45 -0500 (EST) Date: Sun, 6 Nov 2005 14:10:17 -0800 (PST) From: Martin Jambon X-X-Sender: martin@droopy To: Matt Gushee Cc: caml-list@inria.fr Subject: Re: [Caml-list] Testing Camlp4-generated code In-Reply-To: <436D3343.3020809@gushee.net> Message-ID: References: <436D3343.3020809@gushee.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 436E7199.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 436E7197.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 cmo:01 cmo:01 hashtbl:01 mutable:01 bool:01 caml-list:01 beginner's:01 ocaml:01 beginners:01 bug:01 2005,:98 ...:98 wrote:01 abstract:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Sat, 5 Nov 2005, Matt Gushee wrote: > I have developed a tool that generates a module using Camlp4, and I > would like to be able to test the output. The structure is fairly small > and simple, so it should be sufficient to verify that a generated module > is equivalent to a certain hand-coded module ... but is there a reliable > way to do that? My 2 cents: camlp4o pa_yourextension.cmo pr_o.cmo input.ml > auto.ml camlp4o manual.ml > manual2.ml diff auto.ml manual2.ml Of course if you have a lot of automatic identifiers, that's not very convenient. But at least you will get the same indentation if your identifiers have the same length. > If it makes a difference, the output consists mainly of two values: a > data structure which is of an abstract type, and an object. The former > is implemented as follows: > > type data = S of string | L of string list | D of t > and t = { > data : (string, data) Hashtbl.t; > mutable locked : bool; > } > > and the latter is an immediate object, but it inherits from a class > defined in another module. The object is associated with two instances > of the above type, has public methods that get and set values, and may > contain one or more sub-objects similar to itself. > > Thanks in advance for any suggestions. > > -- > Matt Gushee > Englewood, CO, USA > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Martin Jambon, PhD