From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id DE222BC0A for ; Thu, 14 Jun 2007 14:36:00 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.239]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5ECZxje011409 for ; Thu, 14 Jun 2007 14:36:00 +0200 Received: by nz-out-0506.google.com with SMTP id s18so510240nze for ; Thu, 14 Jun 2007 05:35:59 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kN1a4h7TPOHqVcC5CI/KcUDXrb4C7WAoEZLrU36kgBw3C3hUHFm7fimRdhHHmEiqIyJr3quGSsvWqOCrPu2gFPZFyRO+kSOhMde9xH0T+vMx9pnZsc7IMu9sRO3/EheJ2aBmhJqey+kkEynQb02z8x9nD8AstBNB6wY4xQV751I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Vefp6bVWIG2i4zJ5Aw64WrwZfb8eRaD3ZlZIs7YthU+7ekertqQj6PnO+KPO5sBJ3RUrlQA86ISOU1zneLcOyHGFPxBWjQLi9EcPkcpa4K7gso6n3/DnhOMKvRD8ZT/R8xQYun49crGVZ5twxpBU8FhzKfhMrb0StpIOShbDitc= Received: by 10.114.152.17 with SMTP id z17mr1758015wad.1181824559358; Thu, 14 Jun 2007 05:35:59 -0700 (PDT) Received: by 10.114.181.9 with HTTP; Thu, 14 Jun 2007 05:35:59 -0700 (PDT) Message-ID: Date: Thu, 14 Jun 2007 14:35:59 +0200 From: "Nicolas Pouillard" To: caml-list@inria.fr Subject: Re: [Caml-list] Intended behavior of GenerateMap In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070608083625.GA17210@stirner.roentgeninstitut.de> X-j-chkmail-Score: MSGID : 4671362F.003 on discorde : j-chkmail score : XX : 0/20 2 0.000 -> 2 X-Miltered: at discorde with ID 4671362F.003 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 wiki:01 camlp:01 recursive:01 recursive:01 ocaml:01 scrap:98 wrote:01 wrote:01 caml-list:01 caml-list:01 defined:02 defined:02 ast:02 ast:02 I've added to the Camlp4 wiki a documentation about Camlp4MapGenerator and Camlp4FoldGenerator http://brion.inria.fr/gallium/index.php/Camlp4MapGenerator http://brion.inria.fr/gallium/index.php/Camlp4FoldGenerator Enjoy! On 6/13/07, Nicolas Pouillard wrote: > On 6/8/07, Christian Stork wrote: > > Hi, > > > > Is my understanding correct that running "camlp4of -filter map ..." over > > > > class map = Camlp4Filters.GenerateMap.generated > > > > will produce a map class for *all* types defined in the current file -- > > irrespective if the types are incapsulated in a module (which is then > > used for the Camlp4Trash trick)? > > Your understanding is correct. > > > Wouldn't it be much nicer, i.e., more economical and more precise, if > > the above only produces a map class for the most recently defined type > > / mutually recursive types? > > Yes it will be nicer. I don't remember why I didn't do that, perhaps > to don't have to turn the AST definition in one big mutually recursive > type. > > > PS: I came to the above question after reading the source and some > > experimentation. Is there any place where the rationale behind > > GenerateMap/Fold is explained? > > Not really the goal was just to "scrap my boiler plate" in OCaml for > the Camlp4 AST (an economy of merely 5000 lines that are generated). > > -- > Nicolas Pouillard > -- Nicolas Pouillard\