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 33E48BC6B for ; Sat, 23 Jun 2007 20:59:26 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5NIxO8Q011978 for ; Sat, 23 Jun 2007 20:59:25 +0200 Received: by wa-out-1112.google.com with SMTP id m34so1415399wag for ; Sat, 23 Jun 2007 11:59:24 -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:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=a9m5Xc+DqHiRBq+BLN8U4MPevqon/ToTtvJBSEDObmWOd3mEYg+P8GaEViC+Qb6qbvj7ZGwfGbssErr5YfMh1RSH/VTajEsRh4e3sETp735hSj+WVYSzYBVDq2Df6AaO6KvHh+bT4WEXwB5m/W+paa+BTMGi4EKW+wsf7eAlZ00= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qbYgelC3puWARMeIO91/2Ghhi2/0vtv9g0yH2bO1E1vyrtFqYP10xMbCuDaJvuvAqfG291zRfZ2UOA8Gy5uq6lorOvoFuv8GKTAPpkacQUSBlG0vMdytkqZB07eFis2hTX9ulBawvOMxn2Ty2uHzUAzpX0gybzkC7L5P0XOZjf4= Received: by 10.114.66.2 with SMTP id o2mr4035554waa.1182625164340; Sat, 23 Jun 2007 11:59:24 -0700 (PDT) Received: by 10.114.181.8 with HTTP; Sat, 23 Jun 2007 11:59:24 -0700 (PDT) Message-ID: Date: Sat, 23 Jun 2007 20:59:24 +0200 From: "Nicolas Pouillard" To: caml-list@inria.fr Subject: Re: [Caml-list] Intended behavior of GenerateMap Cc: "Joel Reymont" 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 : 467D6D8D.000 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 467D6D8D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 recursive:01 recursive:01 wrote:01 caml-list:01 caml-list:01 defined:02 defined:02 declaration:02 types:03 types:03 module:03 generated:05 separated:05 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)? > > 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? > Indeed it's nicer... These days I've improved this generator to be able to generate, multiple maps and folds (Map{2,3,4...}, Fold{2,3,4...}). And also the combination of both: MapFold{,2,3,4...}. I've also followed your advise by taking in account only the last defined set of mutually recursive types. Note that the Camlp4Trash trick is still needed by those that wants have the type declaration separated from these classes. -- Nicolas Pouillard