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
what do I need to know to understand camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-09-23 (14:56)
From: ben kuin <benkuin@g...>
Subject: what do I need to know to understand camlp4
I'm a Ocaml n00b (without any degree). Therefore I have a faible for
everything that makes Ocamls syntax more algol/imperative like [1]. An
example would be an extension like 'newref'
(http://bitbucket.org/johannes/newref/wiki/Home), which turns:

    print_int !i       into       print_int $i    (* newref *)

so I fiercely try to also perlify the declaration that turns

     let i = ref 3     into        let $i = 3     (* my idea ... *)

but camlp4 makes my head spin. The syntax is very difficult and in a
lot of camlp4 documentation there is AST modification involved, which
is a subject I don't get although I made several attempts. And simple
program transformation with camlp4 (using concrete syntax) is nowhere

Could someone give any idea how I can begin to understand how to write
simple camlp4 extensions?


[1] please don't kill me