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=0.0 required=5.0 tests=none 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 EFFDEBC69 for ; Fri, 30 Mar 2007 13:13:33 +0200 (CEST) Received: from smeltpunt.science.ru.nl (smeltpunt.science.ru.nl [131.174.16.145]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2UBDXmt023386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 30 Mar 2007 13:13:33 +0200 Received: from tandem.cs.ru.nl [131.174.142.18] (helo=tandem.cs.ru.nl) by smeltpunt.science.ru.nl (8.13.7/5.11) with ESMTP id l2UBDUs3023713 for ; Fri, 30 Mar 2007 13:13:30 +0200 (MEST) Received: from tews by tandem.cs.ru.nl with local (Exim 4.63) (envelope-from ) id 1HXF2x-0008Jc-It for caml-list@yquem.inria.fr; Fri, 30 Mar 2007 13:13:31 +0200 From: Hendrik Tews To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] camlp4 3.10 questions References: <17930.60913.933794.204656@tandem.cs.ru.nl> Date: Fri, 30 Mar 2007 13:13:31 +0200 In-Reply-To: (Nicolas Pouillard's message of "Thu, 29 Mar 2007 23:57:59 +0200") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.56 on 131.174.16.145 X-Miltered: at concorde with ID 460CF0DD.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; hendrik:01 tews:01 tews:01 camlp:01 hendrik:01 sig:01 camlp:01 expr:01 expr:01 nop:01 sig:01 interf:01 wrote:01 caml-list:01 writes:01 "Nicolas Pouillard" writes: On 3/29/07, Hendrik Tews wrote: > "Nicolas Pouillard" writes: > > > 2. There are various maps and folds on asts in Sig.Camlp4Ast. How > > can I use them? > > 2/ There is a lot of shortcuts to made the use of them easier when one > just want to hook up only one thing (expressions for instance). > > The same example. > > open Camlp4.PreCast > let f = Ast.map_expr begin function > | <:expr< $x$ + 0 >> | <:expr< 0 + $x$ >> -> x > | e -> e > end in > AstFilters.register_str_item f#str_item > > That should be AstFilters.register_str_item f ? Nop, giving the up to date signature of Ast.map_exp: value map_expr : (expr -> expr) -> map; Where does this come from? I only found value map_expr : (expr -> expr) -> expr -> expr; in Sig.ml line 515. > > 8. How can I process multiple files with the same camlp4 process? You're right only one file (implem or interf). So you can't by command line. Well, I guessed that. But how about using the API? Hendrik