caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Raffalli <christophe.raffalli@univ-savoie.fr>
To: Martin Jambon <martin_jambon@emailuser.net>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: camlp4 question
Date: Thu, 08 Sep 2005 19:44:24 +0200	[thread overview]
Message-ID: <43207878.6010202@univ-savoie.fr> (raw)
In-Reply-To: <Pine.LNX.4.63.0509081017510.5183@droopy>

Martin Jambon a écrit :
> On Thu, 8 Sep 2005, Christophe Raffalli wrote:
> 
>> Yet another question ....
>>
>> I was assuming you oculd ask the type of an expression in camlp4 to do 
>> an induction over it (the type) ....
> 
> 
> You can't, Camlp4 is only about parsing and transforming the syntax tree.
> 
> I imagine you could use a (complicated) 3-step approach:
> 1) preprocess the file with camlp4 and ignore the syntax extensions
> 2) compile the result with -dtypes
> 3) fetch the type information from the .annot file and reparse the 
> original file with camlp4. This time you can get the type of each 
> identifier and expand your special syntax constructs
> 
>> I do not see that in the manual !
>>
>> (you can only construct trees with camlp4, but you cannot match them ?)
> 
> 
> You can use quotations in patterns to read the syntax tree. Is it what 
> you mean?


Yes I saw that later (after acually using the type in MLast t odo the 
same ...)

All that lacks a lot of documentation, but in one day, I found my way ;-)

> 
> Martin
> 
> -- 
> Martin Jambon, PhD
> http://martin.jambon.free.fr


  reply	other threads:[~2005-09-08 17:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-08  8:02 Christophe Raffalli
2005-09-08  8:16 ` Christophe Raffalli
2005-09-08 17:36   ` [Caml-list] " Martin Jambon
2005-09-08 17:44     ` Christophe Raffalli [this message]
2005-09-08 17:41 ` [Caml-list] " Martin Jambon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43207878.6010202@univ-savoie.fr \
    --to=christophe.raffalli@univ-savoie.fr \
    --cc=caml-list@inria.fr \
    --cc=martin_jambon@emailuser.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).