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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B3163BDCB for ; Thu, 8 Sep 2005 19:44:28 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j88HiSk4025608 for ; Thu, 8 Sep 2005 19:44:28 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA10781 for ; Thu, 8 Sep 2005 19:44:27 +0200 (MET DST) Received: from smtp.cegetel.net (mf00.sitadelle.com [212.94.174.67]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j88HiRbd025605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 8 Sep 2005 19:44:27 +0200 Received: from [192.168.144.2] (unknown [84.5.107.164]) by smtp.cegetel.net (Postfix) with ESMTP id A38681A409C; Thu, 8 Sep 2005 19:44:25 +0200 (CEST) Message-ID: <43207878.6010202@univ-savoie.fr> Date: Thu, 08 Sep 2005 19:44:24 +0200 From: Christophe Raffalli User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: fr, en MIME-Version: 1.0 To: Martin Jambon Cc: caml-list Subject: Re: [Caml-list] Re: camlp4 question References: <431FF009.9050608@univ-savoie.fr> <431FF369.8080307@univ-savoie.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 4320787C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4320787B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 caml-list:01 parsing:01 transforming:01 syntax:01 preprocess:01 syntax:01 mlast:01 lacks:01 2005,:98 ....:98 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 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