From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 228A4BB91 for ; Mon, 10 Jan 2005 04:49:42 +0100 (CET) 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 j0A3nfPL029215 for ; Mon, 10 Jan 2005 04:49:41 +0100 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 EAA05903 for ; Mon, 10 Jan 2005 04:49:41 +0100 (MET) From: briand@aracnet.com Received: from jade.spiritone.com (jade.aracnet.com [216.99.193.136]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0A3ndVl015396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 10 Jan 2005 04:49:40 +0100 Received: from soggy.deldotd.com (216-99-206-32.cust.aracnet.com [216.99.206.32]) by jade.spiritone.com (8.12.8/8.12.8) with ESMTP id j0A3nbTm020055 for ; Sun, 9 Jan 2005 19:49:38 -0800 Received: from briand by soggy.deldotd.com with local (Exim 3.36 #1 (Debian)) id 1CnqYj-0002Mz-00 for ; Sun, 09 Jan 2005 19:49:37 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16865.64337.367003.181340@soggy.deldotd.com> Date: Sun, 9 Jan 2005 19:49:37 -0800 To: caml-list@inria.fr Subject: mutually recursive classes (yes - again) X-Mailer: VM 6.92 under Emacs 21.3.1 X-Miltered: at concorde with ID 41E1FB55.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41E1FB53.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; recursive:01 threads:01 val:01 val:01 recursion:01 ...:98 clases:98 ...:98 define:01 brian:03 let:03 let:03 null:05 classes:06 classes:06 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=FORGED_RCVD_HELO,NO_REAL_NAME autolearn=disabled version=3.0.0 X-Spam-Level: I've read the other threads on this common subject and I am not getting understanding. So I present the following very simple example with the hopes that some kind person will help. The definition is very simple making use of the "and" keyword class type a1 = object val a:a1 val b:a2 end and a2 object val c:a2 val d:a1 end ;; It's the implementation which gives me trouble. And yes there is an example in the manual (3.15) and it just doesn't go quite far enough... now I have to define the clases class a1 (x:a1) (y:a2) = object val a = x val b = y end ;; class a2 (x:a2) (y:a1) = object val c = x val d = y end ;; So now let z1 = new a1 ?? ?? ;; let z2 = new a2 ?? ?? ;; Obviously I need to "ground" the recursion somehow, but without some sort of "Null" or "Void" value to use to instantiate the a1 field of a1 it's not obvious to me how to do it. I'm sure it will be embarassingly simple ... I have about 7 more classes in this recursion-fest and a nice orderly way to handle it would be VERY helpful. TIA. Brian