Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Mutually recursive types and classes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nick Name <nick.name@i...>
Subject: [Caml-list] Mutually recursive types and classes
Hi all,

I wish to declare a type like

type a = A of (b -> unit) | ...

where b is a class like

class b = 
object (this)
	method f : a -> unit = 
		function 
		  A f -> f this
                | _ -> unit
end

or, alternatively:

class b =
object 
   inherit [a] otherclass
   ...
end

How can I do such a thing, considering that I can't write an "and"
keyword between a type declaration and a class (or class type)
declaration?

Thanks for help

Vincenzo

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners