How can I learn modern Camlp4?
thx.
ermine
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
The new Camlp4 is not yet fully documented. The official documentation is on a
wiki here:
http://brion.inria.fr/gallium/index.php/Camlp4
Richard Jones' OCaml tutorial site has a simple "foreach" example:
http://www.ocaml-tutorial.org/camlp4_3.10/
Our OCaml Journal published an article about parsers and macros using the new
Camlp4 on 23rd November 2007:
http://www.ffconsultancy.com/products/ocaml_journal/?ol
I once posted a simple compiler for the "Minim" language that was written
using Camlp4:
http://caml.inria.fr/pub/ml-archives/caml-list/2007/08/c92bb15c444511674faf0c898d2e9986.en.html
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
Well, you get what you pay for. ;-)
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
_______________________________________________
With difficulty. That's sad because it's very powerful.
I would suggest starting with Martin's Jambon's tutorial. Even though
it refers to the "old" camlp4 / camlp5, it's still useful to
understand the concepts:
http://martin.jambon.free.fr/extend-ocaml-syntax.html
Then take a look at Martin's example of what changed between the two
versions:
http://martin.jambon.free.fr/examples/pa_json_static_3100beta.html
The camlp4 wiki has already been mentioned, and is very useful. This
is probably the most useful reference page of all:
http://brion.inria.fr/gallium/index.php/AST
Finally take a look at some real examples:
http://caml.inria.fr/cgi-bin/hump.en.cgi?sort=0&browse=92
Rich.
--
Richard Jones
Red Hat