From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q1LDTugn010038 for ; Tue, 21 Feb 2012 14:29:56 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiYEANSbQ0/RVdgvkGdsb2JhbABDFqBQkC58CCIBAQEBCQkNBxQEI4FzAQEBBBICJAgBGxIKAQEDDAYFCw0JBBIPCQMCAQIBDwIRAQUBChIGDQEFAgEBDhCHZ5scCotygnGFMT+IcwIFC4hxgXaBBAgFDRMDAQEHBgIDBgMHAgQFAQ8ChA0CBQISAQICgysEiE+MaYcXg3wEgxY9hCE X-IronPort-AV: E=Sophos;i="4.73,457,1325458800"; d="scan'208";a="132285069" Received: from mail-qw0-f47.google.com ([209.85.216.47]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Feb 2012 14:29:50 +0100 Received: by qadz30 with SMTP id z30so4841405qad.6 for ; Tue, 21 Feb 2012 05:29:50 -0800 (PST) Received-SPF: pass (google.com: domain of bobzhang1988@gmail.com designates 10.229.78.89 as permitted sender) client-ip=10.229.78.89; Authentication-Results: mr.google.com; spf=pass (google.com: domain of bobzhang1988@gmail.com designates 10.229.78.89 as permitted sender) smtp.mail=bobzhang1988@gmail.com; dkim=pass header.i=bobzhang1988@gmail.com Received: from mr.google.com ([10.229.78.89]) by 10.229.78.89 with SMTP id j25mr19745298qck.46.1329830990162 (num_hops = 1); Tue, 21 Feb 2012 05:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=EQVRHrm0GCweevAuxOBEzsLpKnDacZTWHy2SMYSwa+U=; b=B8Kqzhc0YvCfiP0IATharTuVMuaLil3O0vBRVeXLf4xs54ZcHmu23y+6nqsNvFGfda so0EgP1jmutcFGrBmKo4sE9d7G9GU97ojzQCBw9TEkQn+3n8Dz+gULRi+JcE9u4QSsL4 0ICcG3LfS6DcoSKgrA7rDMbMaE6DhysBndsB4= Received: by 10.229.78.89 with SMTP id j25mr16669754qck.46.1329830990040; Tue, 21 Feb 2012 05:29:50 -0800 (PST) Received: from Hongbos-MacBook-Air.local ([66.250.143.212]) by mx.google.com with ESMTPS id el3sm58073245qab.8.2012.02.21.05.29.49 (version=SSLv3 cipher=OTHER); Tue, 21 Feb 2012 05:29:49 -0800 (PST) Message-ID: <4F439C4C.3030000@gmail.com> Date: Tue, 21 Feb 2012 08:29:48 -0500 From: Hongbo Zhang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Gabriel Scherer CC: Caml List References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Some utilities about camlp4 On 2/21/12 5:22 AM, Gabriel Scherer wrote: Hi, > I had trouble being sure what "meta filter" you were talking about. > Here's what I found out, in case other people on the list wondered the > same: the "meta" part of Camlp4 is about turning a value into a piece > of OCaml AST representing the syntax of this value. The "meta" filter > is a kind of type-conv plugin -- anterior to type-conv -- that reads > the declarations of algebraic datatypes and adds declarations for > functions doing that "meta" work on this datatype, taking values at > this type and returning pieces of Camlp4 AST. yes. > If I understand correctly, here is the change you did -- maybe you > should put this information in a README somewhere: > instead of reading the type declarations in the whole file being > filtered, you only read those contained in a so-called "trash module", > whose name is configurable by the user (default Camlp4Trash). You then > produce declarations for metafunctions on demand, as in the old code, > but you *do not* reproduce the content of the "trash module" -- the > type declarations. Yes, so generally you will combined it with INCLUDE like this module Trash = struct INCLUDE "xx.ml" end This could avoid linking camlp4 (very big) when you don't need it. It will find all type definitions in xx.ml(not the last one). It's pretty easy to mix with other syntax extensions now. > Are there other notable differences between the two implementations? > You said that the upstream one is "buggy", what kind of bugs did you > encounter? It could be interesting to fix them upstream. the meta_float, meta_int never compiles in the original distribution > > It looks like you are doing this new implementation to be able to have > the meta-functions defined in a different module than the original > type declaration. What are the advantages of doing this? Could you > tell us a bit more about your initial motivations? another piece, the original file Camlp4FiltersMetaFilter was quite unreadable, and impossible to modify according to custom needs(at least I found it hard to read and modify...) Thanks > On Tue, Feb 21, 2012 at 12:58 AM, bob zhang wrote: >> Hi, List >> the meta filter distributed with camlp4 is buggy and unmodular, I >> put a modular one here >> http://seas.upenn.edu/~hongboz/meta_filter.zip >> >> building with syntax extension is really easy provided this file >> http://www.seas.upenn.edu/~hongboz/myocamlbuild.ml >> It works with .inferred.mli, .pp.ml as well >> -- >> Best, bob >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa-roc.inria.fr/wws/info/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >>