From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA13272; Thu, 31 Jan 2002 00:32:22 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA13159 for ; Thu, 31 Jan 2002 00:32:21 +0100 (MET) Received: from favie.faith.gr.jp (favie.faith.gr.jp [61.127.175.250]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0UNWJr12403 for ; Thu, 31 Jan 2002 00:32:19 +0100 (MET) Received: from localhost (dhcp7.faith.gr.jp [192.168.1.17]) by favie.faith.gr.jp (8.9.3/8.9.3) with ESMTP id IAA24060; Thu, 31 Jan 2002 08:32:09 +0900 To: warplayer@free.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] Mixed class / type In-Reply-To: <005901c1a9a7$b1b97b00$8f00a8c0@warp> References: <005901c1a9a7$b1b97b00$8f00a8c0@warp> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20020131083125H.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 31 Jan 2002 08:31:25 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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. A light workaround would be class wmenuitem : [ `Mainmenu of wmenu | `Menuitem of wmenuitem] -> ... and wmenu : object ... end Since polymorphic variants do not need to be defined, the problem does not appear. Jacques Garrigue ------------------- 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