Version française
Home     About     Download     Resources     Contact us    
Browse thread
camlp4 3.10 questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <H.Tews@c...>
Subject: Re: [Caml-list] camlp4 3.10 questions
"Nicolas Pouillard" <nicolas.pouillard@gmail.com> writes:

   On 3/29/07, Hendrik Tews <H.Tews@cs.ru.nl> wrote:
   > "Nicolas Pouillard" <nicolas.pouillard@gmail.com> 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