Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Mixed class / type
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Warp <warplayer@f...>
Subject: [Caml-list] Mixed class / type
Hello,

I got this problem :
- two classes called wmenu and wmenuitem, are mutaly recursive
- one wmenuitem can be constructed either with a wmenu or with a wmenuitem

so I need a type like this :

type menu =
    Mainmenu of wmenu
    | Menuitem of wmenuitem

So I tryied :

type menu = .....
and
    class wmenuitem : menu -> object ... end
and
    class wmenu : object ... end

But it doesn't work.
Any clue is welcomed.

Warp

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr