Browse thread
Objects, dynamic cast, Obj.magic abuse and dragons
[
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: | -- (:) |
| From: | Berke Durak <berke.durak@e...> |
| Subject: | Re: [Caml-list] Objects, dynamic cast, Obj.magic abuse and dragons |
Dirk Thierbach wrote : > I think I wouldn't use objects at all in this situation. You're trying > to model the location-tree of "physical" things. A tree must be uniform > in its contents, but you want to put different things into it. That > means you must use an algebraic type, or variants. I'd probably either > use a zipper, or connect the tree nodes with "refs" for the non-pure > version. You are preaching to the choir. I'm not Gerd Stolpmann and I don't use objects very much because every time I try I get seven-page-long errors. However it seems that objects could be actually useful in situations where you have a hierarchy of objects with behaviours, such as a graphical user interface made of widgets, or, say, a text adventure. -- Berke DURAK