English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2001-01-31 (10:58)
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