caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Creating a tree type
@ 2005-02-07 11:41 Jonathan Roewen
  2005-02-07 11:58 ` Richard Jones
       [not found] ` <200502071601.01981.jon@jdh30.plus.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Roewen @ 2005-02-07 11:41 UTC (permalink / raw)
  To: caml-list

Hi,

What would be the best approach to creating a tree type such that at
each node, it has some sort of reference to the parent node? Is this
an example of when ocaml's OO side would be more useful?

Basically, I'm creating a UI for my OS; since events will typically
bubble from leaf nodes up through their ancestors until either the
event has been handled or have reached the root node, being able to
reference the parent node efficiently (and easily) is a requirement.

I've tried a recursive type, but both the defintion and code to make
use of it is damn ugly and complicated--there just has to be a better
way to do this sort of thing nicely in ocaml.

Regards,

Jonathan Roewen
--
Desert Spring-Time: An OCaml OS -- http://www.purevoid.org/os/progress/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-09  6:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-07 11:41 [Caml-list] Creating a tree type Jonathan Roewen
2005-02-07 11:58 ` Richard Jones
     [not found] ` <200502071601.01981.jon@jdh30.plus.com>
2005-02-09  4:28   ` Jonathan Roewen
2005-02-09  6:43     ` Pierre Casteran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).