Browse thread
Type problem... possible design problem
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2004-12-18 (08:04) |
From: | Jon Harrop <jon@j...> |
Subject: | Re: [Caml-list] Type problem... possible design problem |
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.