From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 30646BDCB for ; Thu, 8 Sep 2005 19:37:31 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j88HbUFD003532 for ; Thu, 8 Sep 2005 19:37:30 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA10575 for ; Thu, 8 Sep 2005 19:37:30 +0200 (MET DST) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j88HbTtY003526 for ; Thu, 8 Sep 2005 19:37:29 +0200 Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id 9F77CCCF668; Thu, 8 Sep 2005 13:37:27 -0400 (EDT) Received: from frontend3.messagingengine.com ([10.202.2.152]) by frontend1.internal (MEProxy); Thu, 08 Sep 2005 13:37:27 -0400 X-Sasl-enc: SW7rMuXrsfSE035epVxQZmXGwvb3E4u02u6qpEgeNfZo 1126201047 Received: from [172.16.112.115] (burnham.ljcrf.edu [192.231.106.2]) by frontend3.messagingengine.com (Postfix) with ESMTP id 002661E5; Thu, 8 Sep 2005 13:37:26 -0400 (EDT) Date: Thu, 8 Sep 2005 10:36:27 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@droopy To: Christophe Raffalli Cc: caml-list Subject: Re: [Caml-list] Re: camlp4 question In-Reply-To: <431FF369.8080307@univ-savoie.fr> Message-ID: References: <431FF009.9050608@univ-savoie.fr> <431FF369.8080307@univ-savoie.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at nez-perce with ID 432076DA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 432076D9.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 christophe:01 raffalli:01 parsing:01 transforming:01 syntax:01 preprocess:01 syntax:01 2005,:98 ....:98 ....:98 wrote:01 compile:01 expression:01 jambon:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 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