From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 96D58BC6C for ; Wed, 25 Apr 2007 06:56:42 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3P4ugo9030756 for ; Wed, 25 Apr 2007 06:56:42 +0200 Received: by ug-out-1314.google.com with SMTP id o4so330984uge for ; Tue, 24 Apr 2007 21:56:42 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=hG+MMq1Zb7zonn0/VbWqOWeKGnJCRjzAcm97YLMYweh/Dk03Gk99TmrFoloe7yJ9FwtAatFOLkKC9FFay4xKe2XBA0L8sUPgXUxjg+dGj5BVJJ761Tv7yf+oC7Zl3ffufdvQbldkWRs6s6yYfBlkEI8WPxvkU1OwG22PqlC2rQg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=LO7vTD8BM+uzzlHUPq8bsfqwuWOwkPNGdKx7ruj734sPUrYibvXS42NHYloE4EmDCHvZYdbkhJ21onquxX+SfCEovblif7LxPmDlMuRaZuLLaJsBxlhsmhaj41h0104Zxx78vHmYhnvxaIjtKbwXFK/NAhzX5uKLfVReTFZ9qRE= Received: by 10.67.10.18 with SMTP id n18mr1121555ugi.1177477002088; Tue, 24 Apr 2007 21:56:42 -0700 (PDT) Received: from ?192.168.1.34? ( [81.37.190.201]) by mx.google.com with ESMTP id y34sm1233185iky.2007.04.24.21.56.40; Tue, 24 Apr 2007 21:56:41 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <15893C08-FD0C-456B-A12F-DADCF6CC95F9@gmail.com> References: <15893C08-FD0C-456B-A12F-DADCF6CC95F9@gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: Re: Transforming of ASTs and polymorphic variants Date: Wed, 25 Apr 2007 05:56:40 +0100 To: Caml List X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 462EDF8A.000 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 462EDF8A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; transforming:01 variants:01 expr:01 expr:01 polymorphic:01 typing:01 macros:01 tend:02 string:02 unit:03 let:03 asts:07 asts:07 example:10 end:12 I also tend to write "macros" to lessen the pain of typing up the ASTs in my unit tests. I may have in both a.ml and b.ml (contrived example) type expr = VarIdent of string I then end up with duplicate let id x = VarIdent x in both a.ml and b.ml since A.expr and B.expr are of a different type. It would be great if I could write id once and have it work for both A.expr and B.expr. Thanks, Joel -- http://wagerlabs.com/