From: Martin Jambon <martin_jambon@emailuser.net>
To: Christophe Raffalli <christophe.raffalli@univ-savoie.fr>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: camlp4 question
Date: Thu, 8 Sep 2005 10:36:27 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.63.0509081017510.5183@droopy> (raw)
In-Reply-To: <431FF369.8080307@univ-savoie.fr>
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?
Martin
--
Martin Jambon, PhD
http://martin.jambon.free.fr
next prev parent reply other threads:[~2005-09-08 17:37 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 ` Martin Jambon [this message]
2005-09-08 17:44 ` [Caml-list] " Christophe Raffalli
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=Pine.LNX.4.63.0509081017510.5183@droopy \
--to=martin_jambon@emailuser.net \
--cc=caml-list@inria.fr \
--cc=christophe.raffalli@univ-savoie.fr \
/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).