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 D0C29BB81 for ; Mon, 10 Oct 2005 15:42:46 +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 j9ADgkOm009253 for ; Mon, 10 Oct 2005 15:42:46 +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 PAA23242 for ; Mon, 10 Oct 2005 15:42:45 +0200 (MET DST) Received: from smtp15.wanadoo.fr (smtp15.wanadoo.fr [193.252.23.84]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j9ADgjO2009250 for ; Mon, 10 Oct 2005 15:42:45 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1502.wanadoo.fr (SMTP Server) with ESMTP id 7568170000CC for ; Mon, 10 Oct 2005 15:42:45 +0200 (CEST) Received: from wwinf1521 (wwinf1521 [172.22.146.45]) by mwinf1502.wanadoo.fr (SMTP Server) with ESMTP id 69F4A700008B; Mon, 10 Oct 2005 15:42:45 +0200 (CEST) X-ME-UUID: 20051010134245434.69F4A700008B@mwinf1502.wanadoo.fr Message-ID: <14893115.1128951765427.JavaMail.www@wwinf1521> From: yoann padioleau Reply-To: padator@wanadoo.fr To: Christian Lindig Subject: Re: [Caml-list] possible to define a type where = is forbidden ? Cc: Caml List Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [193.54.76.165] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-CC: |~| X-WUM-REPLYTO: |~| Date: Mon, 10 Oct 2005 15:42:45 +0200 (CEST) X-Miltered: at concorde with ID 434A6FD6.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 434A6FD5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 tokens:01 caml-list:01 2005,:98 wrote:01 polymorphic:01 expression:01 define:01 strings:01 strings:01 diff:01 diff:01 caml:02 ast:02 ast:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 > On Oct 10, 2005, at 2:32 PM, yoann padioleau wrote: > > > I am making a program analysis tool and in my AST I had previously > > tokens represented as strings, > > but now I want also to associate the line numbers of those strings. > > I like to suggest a different technique that does not require to change > the representation of all branches in an AST. You can find it in an > earlier posting here: > > http://caml.inria.fr/pub/ml-archives/caml-list/2003/09/ > f81c8063ed4878e06f1ddd8010256050.en.html Interesting technique :) but I think that it would not solve my problem. To be more precise my program analysis tool try to compute "diff" between differents AST. So we love to use pattern-patching and to (ab)use the polymorphic = to compare stuff. I don't see how your ExprAt technique will make this easier (not to mention that it also makes the pattern matching ugly because I would have to wrap every expression with his ExprAt because I want that the resultting Ast_diff contain also line number.