English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2007-03-29 (21:47)
From: Hendrik Tews <H.Tews@c...>
Subject: Re: [Caml-list] camlp4 3.10 questions
"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 ?

   > 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

    camlp4o printer.cmo test.ml printer.ml
    Usage: camlp4 [load-options] [--] [other-options]

Thanks for all the answers,