From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id ABA2DBB81 for ; Sat, 18 Dec 2004 09:04:09 +0100 (CET) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBI8499P005145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 18 Dec 2004 09:04:09 +0100 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1CfZZP-000Ome-4W for caml-list@yquem.inria.fr; Sat, 18 Dec 2004 08:04:07 +0000 From: Jon Harrop To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Type problem... possible design problem Date: Sat, 18 Dec 2004 08:07:05 +0000 User-Agent: KMail/1.6.2 References: <41C37CF7.5050400@ntlworld.com> In-Reply-To: <41C37CF7.5050400@ntlworld.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200412180807.05925.jon@jdh30.plus.com> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41C3E479.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 nodes:01 nodes:01 o'caml:01 cheers:01 ...:98 node:01 arbitrary:01 graph:01 leaf:01 leaf:01 modules:01 variant:02 types:02 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 Saturday 18 December 2004 00:42, chris.danx wrote: > What is the solution to the following problem? There are two types of > object in a scene graph, those that may have children and those may not. > A leaf may not have children. Could you redefine this as "There is one type of node in a scenegraph, which has an arbitrary number of children"? Leaf nodes are then nodes with zero children. > I've not programmed in O'Caml for a while and am not yet fully > comfortable with ocamls object system anyway, so I may be being silly. > Can anyone shed some light on a solution to this? Why are you using OO? Can you do what you want with modules and variant types more easily? Cheers, Jon.