From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA32339 for caml-red; Sun, 22 Oct 2000 21:41:21 +0200 (MET DST) 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 OAA19724 for ; Sat, 21 Oct 2000 14:24:19 +0200 (MET DST) Received: from sirius-b.ihep.su (sirius-b.ihep.su [194.190.161.4]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id e9LCO8j19219; Sat, 21 Oct 2000 14:24:09 +0200 (MET DST) Received: from ihep.su (ihep.ihep.su [194.190.161.127]) by sirius-b.ihep.su (8.10.0/8.10.0) with SMTP id e9LCO4v18000; Sat, 21 Oct 2000 16:24:04 +0400 (MSK) X-Sender: vsl@ontil.ihep.su Received: from ontil.ihep.su by ihep.su (5.65v4.0/RELCOM-IHEPv4.7) id AA05708; Sat, 21 Oct 2000 16:24:01 +0400 Date: Sat, 21 Oct 2000 16:22:21 +0400 (MSD) From: Vitaly Lugovsky To: Chris Hecker Cc: Pierre Weis , caml-list@inria.fr Subject: Re: circular types? In-Reply-To: <4.3.2.7.2.20001020142837.02ee31f0@shell16.ba.best.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr On Fri, 20 Oct 2000, Chris Hecker wrote: > >It's exactly similar to value definitions: put a ``and'' between the > >two recursive definitions. > >type foo = B of bar > >and bar = F of foo > > Ah, thanks! Is there any way to do it without the "and"? In other words, what if I want to do this but the types are defined "far away" from each other in the source. The "and" solution works, but I'm looking for something like forward declarations from C++: > > class foo; > class bar; > class foo { bar *Bar; }; > // ...lots of stuff... > class bar { foo *Foo; }; It's just a C++ way. Sucks. "and" construction is much more informative. -- V.S.Lugovsky aka Mauhuur (http://ontil.ihep.su/~vsl) (UIN=45482254)