On Thu, 20 Jul 2006, Bünzli Daniel wrote: > I'm sorry to say that but I regard (maybe out of ignorance) camlp4 as very > low level and brittle tool (not to say hack). An obvious proof of this to me > is the composition problem which is according to previous messages is not > solved by camlp4. In theory the system of quotations allows you to use as many quotation expanders as you want. Quotations are well delimited and do not interfere with each other, but look a bit ugly and are restricted to exprs and patts. Otherwise it's possible to define well-disciplined syntax extensions. For example, if each new syntax construct (new rule) is forced to start with a unique, registered keyword and end with "end", then different syntax extensions that follow this rule should play well together. Deleting or rewriting existing rules would of course be forbidden. And tools like Declare_once [1] should become builtins. So if you take my favorite syntax extension (micmatch), you would need to create a new keyword, let's say "mm": match "Hello World!" with / "Hello"~ blank+ (alnum+ as user) / -> Some user | _ -> None could become mm match "Hello World!" with mm "Hello"~ blank+ (alnum+ as user) end -> Some user | _ -> None end To the OCaml development team: Would such a convention make sense? Could there be special restricted EXTEND statement that only accepts that kind of rules, and registers the keywords to avoid unexpected clashes between extensions that try to use the same leading keyword? It would be really nice to have official guidelines on how to develop clean syntax extensions, if not automatic enforcement. That's all I can say, I don't have time to spend playing with the new Camlp4 or trying to understand what MetaOCaml is about. Any official word about the metaprogramming issues in OCaml would be appreciated! I am sorry to say that, but there is way too much mystery floating around Camlp4. A web page that presents a roadmap for the development of OCaml language and tools including Camlp4 would be much appreciated. Martin [1] Declare_once: look for it at http://www.yl.is.s.u-tokyo.ac.jp/~oiwa/en_US.ISO-8859-1/pub/caml/regexp-pp-1.0.0/README.match-regexp -- Martin Jambon, PhD http://martin.jambon.free.fr