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 TAA32393; Wed, 9 Jan 2002 19:25:10 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA31295 for ; Wed, 9 Jan 2002 19:25:09 +0100 (MET) Received: from mel-rto2.wanadoo.fr (smtp-out-2.wanadoo.fr [193.252.19.254]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g09IP8P11865 for ; Wed, 9 Jan 2002 19:25:08 +0100 (MET) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto2.wanadoo.fr; 9 Jan 2002 19:25:08 +0100 Received: from debian (80.8.74.46) by mel-rta9.wanadoo.fr; 9 Jan 2002 19:24:55 +0100 Received: from moi by debian with local (Exim 3.33 #1 (Debian)) id 16ONPP-0000xt-00 for ; Wed, 09 Jan 2002 19:25:07 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Nested classes and types References: <000201c1992d$b4f0e9f0$a7804d8c@prometheus> From: Remi VANICAT Date: 09 Jan 2002 19:25:07 +0100 In-Reply-To: <000201c1992d$b4f0e9f0$a7804d8c@prometheus> Message-ID: <87sn9fidq4.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "Boris Yakobowski" writes: > I need to declare two types depending one on the other ; one of them is > a class type, with a menber variable of the second type, and the other > one is a basic type with a constructor needing an argument of the first > type. > > Example : > > class type c_foo = > object > val val_foo : t_foo > end > and > t_foo = Foo of c_foo > > However, that syntax doesn't work ; is there a correct one ? not exactly, but there is a workaround : class type ['a] c_foo1 = object val val_foo : 'a end type t_foo = Foo of (t_foo c_foo1) class type c_foo = object inherit [t_foo] c_foo1 end -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- 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