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 A42B0BC69 for ; Thu, 29 Mar 2007 23:58:01 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2TLw1A4014849 for ; Thu, 29 Mar 2007 23:58:01 +0200 Received: by ug-out-1314.google.com with SMTP id q2so709914uge for ; Thu, 29 Mar 2007 14:58:01 -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=mS3d0tCW6lp3YtTx0DKTWRu20e3PoraDnt+N3xnoczlyNazqdTVjo+7+NIEyeEKwKO1MpT3s17E4ZyUYIhMJGsbFlyZtuaHksR0d4cGs2X8zI8CfMw2O1iPaZj5xVxIru/6MBQ2pI1HFSFtbZcZPh/VjJESN19VMM0o92Bv4VNg= 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=auh0KhVOO1OpGQBGpuAqarDP/FVcNLpSfZmoak5FvvWSAHi7/hF+qnjC/MvwGP0cYFErSLPbys2Jixpx7NatLBAJ8Ujv5cLCj56qn8vIkn2G4E5mpA0pu5VvYl4L3rCoHzG0LOjXfOBuPqOc1uHMpbT8yjPK38EljKlW/X3EO3U= Received: by 10.114.78.1 with SMTP id a1mr481904wab.1175205480237; Thu, 29 Mar 2007 14:58:00 -0700 (PDT) Received: by 10.114.183.4 with HTTP; Thu, 29 Mar 2007 14:57:59 -0700 (PDT) Message-ID: Date: Thu, 29 Mar 2007 23:57:59 +0200 From: "Nicolas Pouillard" To: "Hendrik Tews" Subject: Re: [Caml-list] camlp4 3.10 questions Cc: caml-list@yquem.inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <17930.60913.933794.204656@tandem.cs.ru.nl> X-j-chkmail-Score: MSGID : 460C3669.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 460C3669.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 hendrik:01 tews:01 tews:01 sig:01 camlp:01 expr:01 expr:01 nop:01 cmo:01 interf:01 wrote:01 caml-list:01 writes:01 ast:02 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; A map value is an object that waits for a starting order. f#str_item <:str_item< ... >>; f#expr <:expr< ... >>; ... Since AstFilters.register_str_item waits for a (str_item -> str_item) function I give it f#str_item. > > 8. How can I process multiple files with the same camlp4 process? > > As always ? > > How is as always? Two files on the command line give the usage > info: > > camlp4o printer.cmo test.ml printer.ml > Usage: camlp4 [load-options] [--] [other-options] > Options: > .... You're right only one file (implem or interf). So you can't by command line. -- Nicolas Pouillard