Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] a design problem requiring downcasting? (long)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-09-26 (15:27)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] a design problem requiring downcasting? (long) writes:

> Hi,
> If I understood your problem, Jacques Garrigue has shown a way
> to allow "safe" downcast, that is to say that if you can't downcast you
> cleanly get an exeption. You are required to register your class for
> all the downcasts you wants, and it will work only for them (i.e. if
> you don't register you can't downcast). This is the "memo" class
> in the code below.
> Following this idea, your simulation manager has to define all the interfaces it
> will be using, and the simulations have to register themselves before
> beeing used.
> Code follows :

It is what my hweak library is doing. the only difference is that I
use my own Hashtbl with weak pointer (so object that are in my memo
object can be collected by the GC).
Rémi Vanicat
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: