Le samedi 10 décembre 2011 à 19:10 +0000, Wojciech Meyer a écrit : > I'm asking, because certainly it would be a very wanted feature. I can > see two major limitations of the current Camlp4/p5 system: > > - no way of recursively expand syntax, generate some code and then > re-generate again using same syntax (staging, it's partially there as > you can compose syntax extensions, but there is no way to keep > expanding until fixpoint) > > - no way of making an action based on inferred type during previous stage > of macro expansions. This is biggie. It needs either using `ocaml -i' hack > or kind of type reflection support in the compiler. > > Also, a packrat lexless parsers with a way to compose them would be a > huge thing too. > > I'm aware that these are huge changes to Camlp4, but it would make > meta programming more powerful and push Camlp4 to the next level.
Sure. But it seems that the next version of OCaml will have runtime types, see http://www.lexifi.com/blog/runtime-types , so maybe it is not needed to add this to camlp4. Also they are problems that i don't know how to solve with the camlp4 approach. For example consider: let x = 1 type int = A let y = A The typer knows that x has the type (int, 1) and y has the type (int, 42). But what you send to ocaml is a parse tree, and you cannot make this difference in the parse tree. Cheers, -- Jérémie -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs