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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7541DBC6B for ; Wed, 13 Jun 2007 13:36:59 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.180]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5DBawY7031487 for ; Wed, 13 Jun 2007 13:36:58 +0200 Received: by wa-out-1112.google.com with SMTP id m34so215037wag for ; Wed, 13 Jun 2007 04:36:57 -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=kQ8u0zmPPjbSEtdLhqyYep5iEACxzFhRY8nzoRM+GYGpiksN3q2qF+PftRpEwlkFtEVJlrb0wTtwENcfhUcRWLRysXTO/NdD28fYzM0qUeqQboFMCbxW6JoQ4YyLxsEYqu+LIazqaCn6EB4kQ5GmH/Wym8MdOm/dAt75N4qHX2U= 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=PuQBJqL95tj6EF/5UHDTlLd5W2DpGLC2xjfLSRm81UkJxnY1PRIFhMPozVjt6KjNrxy68MNfhFfFQOoWI9XNPp2gd/HHB857UUUsWc6DrW70M4TknhAIoOn5a495KUDiYgxwXwG8K9duIjuFXmVz+g6YZtsIcZF6T9anVxJK+dM= Received: by 10.114.24.1 with SMTP id 1mr529072wax.1181734592931; Wed, 13 Jun 2007 04:36:32 -0700 (PDT) Received: by 10.114.181.9 with HTTP; Wed, 13 Jun 2007 04:36:32 -0700 (PDT) Message-ID: Date: Wed, 13 Jun 2007 13:36:32 +0200 From: "Nicolas Pouillard" To: caml-list@inria.fr Subject: Re: [Caml-list] Intended behavior of GenerateMap In-Reply-To: <20070608083625.GA17210@stirner.roentgeninstitut.de> 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 : 466FD6DA.000 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 466FD6DA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 recursive:01 recursive:01 ocaml:01 scrap:98 wrote:01 caml-list:01 caml-list:01 defined:02 defined:02 ast:02 ast:02 types:03 types:03 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