From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 A3ADBBB81 for ; Mon, 13 Dec 2004 13:32:05 +0100 (CET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBDCW3MX002086 for ; Mon, 13 Dec 2004 13:32:04 +0100 Received: from [192.168.1.200] (ppp209-112.lns2.syd3.internode.on.net [203.122.209.112]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iBDCVq7D017070; Mon, 13 Dec 2004 23:01:53 +1030 (CST) Subject: Re: [Caml-list] recursive types From: skaller Reply-To: skaller@users.sourceforge.net To: Damien Pous Cc: caml-list@yquem.inria.fr In-Reply-To: <20041213105850.46bc515c@localhost.localdomain> References: <20041213.184406.74727251.keiko@kaba.or.jp> <20041213105850.46bc515c@localhost.localdomain> Content-Type: text/plain Organization: Message-Id: <1102941111.2578.184.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 13 Dec 2004 23:31:52 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41BD8BC3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 recursive:01 sourceforge:01 damien:01 wrote:01 bool:01 glebe:01 061:98 nsw:01 snail:02 2037:02 exp:02 exp:02 types:02 programming:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Mon, 2004-12-13 at 20:58, Damien Pous wrote: > You can do something this: > > type 'a exp_ = [`Num of 'a |`Neg of 'a] > > class type obj = object > method eql : obj exp_ -> bool > end > > type exp = obj exp_ Or the converse (parameterise the class instead). -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net