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
classes mutually recursive
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sylvain Kerjean <skerjean@i...>
Subject: classes mutually recursive
I have to program a class A whose method m produces an object of class
B,with the property that B inherits from A :

class A =
method m = new B

class B =
inherit A

Of course it leads to a type clash, but as the manual exhibits an
example of the observer/notifier
problem, if someone could explain me a little more about a trick to get
the behaviour i need, it would be very kind !!

PS : sorry for my poor english, and no i can not change my architecture
of classes cause i interface an existing API (for those who are
interested, it is the architecture of the BHandler/BLooper in BeOS)

Sylvain Kerjean
IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
Tél: +33 (0) 2 99 84 75 99, Fax: +33 (0) 2 99 84 71 71