Hello, It seems that objects are back in fashion again on the list. As records of functions or functors dont quite cut the mustard for some applications, I decided to give Ocaml's object system another try. I tried to implement a conventional text adventure using those, of the "go north take sword kill dragon" kind. Actually I had one such small prototype I wrote while learning Java, so I decided to port that one. I've stumbled on a situation where I feel dynamic casting could be useful. At least, that is the way I did it in the Java version. I've worked around it using Obj.magic, but I can't check the class, so this could lead to nastiness. I'd rather eat a runtime Class_cast_exception than a segmentation fault. In this adventure, things can contain other things; a class physical has a list of things it contains, and an optional pointer to its container. Persons, places and objects are things so they inherit from physical. Hence, a forest is a place that can contain a sword (an object), a dragon (a person) or another place (a small house). Persons can be contained in places or things (coffins). The problem is that the main game loop gets the current location by taking the container of the hero... which is a physical. However, it needs to call the place-specific method "go". I'm submitting my example so that you can propose alternative solutions. A few ideas: * Add a go method in physical, raise an exception - not scalable, if I want to add other categories of things, I'll have to add the corresponding method to physical. * Parametrize physical with the type of contents. * Use a sum type; but then it wouldn't be an object any more, and it's a centralized place. -- Berke DURAK