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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] Mutually recursive classes
On Mon, 2003-11-03 at 21:48, Damien wrote:
> Hello,
> I would like to create two mutually recursive classes,

There is a mechanical workaround for this.

You first parameterise your classes,
then you use a type/class definition
instantiating the parameters: the latter
construction allows recursive 'and's.

For example, 

class type A' ['B'] ..
class type B' ['A'] ..

type A = B A' and B = A B'

[and similarly for classes, using let instead]

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: