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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 0078DBB9A for ; Sun, 6 Nov 2005 22:18:12 +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 jA6LICLW032373 for ; Sun, 6 Nov 2005 22:18:12 +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 WAA15117 for ; Sun, 6 Nov 2005 22:18:11 +0100 (MET) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jA6LIBrU032366 for ; Sun, 6 Nov 2005 22:18:11 +0100 Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id 420EBCDB1BA; Sun, 6 Nov 2005 16:18:09 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.151]) by frontend1.internal (MEProxy); Sun, 06 Nov 2005 16:18:09 -0500 X-Sasl-enc: Rfh68W3ESXO1A5us/0DPmGk4xxD3X12oz6wZbRcQn72T 1131311885 Received: from [172.16.13.137] (burnham.ljcrf.edu [192.231.106.2]) by frontend2.messagingengine.com (Postfix) with ESMTP id 4D8D35703B5; Sun, 6 Nov 2005 16:18:04 -0500 (EST) Date: Sun, 6 Nov 2005 14:16:38 -0800 (PST) From: Martin Jambon X-X-Sender: martin@droopy To: Martin Jambon Cc: Matt Gushee , caml-list@inria.fr Subject: Re: [Caml-list] Testing Camlp4-generated code In-Reply-To: Message-ID: References: <436D3343.3020809@gushee.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at nez-perce with ID 436E7314.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 436E7313.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 beginner's:01 ocaml:01 beginners:01 bug: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 Sun, 6 Nov 2005, Martin Jambon wrote: > 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 I meant reindenting: camlp4o pr_o.cmo 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 > > _______________________________________________ > 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 Store and share your bioinformatics tips at http://wikiomics.org