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
2 camlp4 questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-06 (00:52)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] 2 camlp4 questions
On 4/5/07, Hendrik Tews <H.Tews@cs.ru.nl> wrote:
> Hi,
> I am still reading the camlp4 sources:

[... an already answered question ...]

> 2. Camlp4Bin calls a cleaning pass before printing. The cleaner
>    does things like
>       <:expr< $e$; $ <:expr<>> $ >> -> self#expr e
>    What do these empty quotations ``<:expr<>>'' stand for? Are
>    these just the things that filters leave behind if they delete
>    a node?

Yes it can be some filters junks, but not only.
If you construct something like a sequence, a tuple, a sum type
(everything that was a list before), you will often want to use some
folding style and then these nil quotations will be helpful as initial

At some other points these nil quotations are not useless (and so not
removed by that cleaner phase). For instance, if there is no guard in
a match that's represented by an nil expression:

<:match_case< $p$ -> $e$ >> = <:match_case< $p$ $when:<:expr<>>$ -> $e$ >>


Nicolas Pouillard