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 HAA23155 for caml-red; Tue, 24 Oct 2000 07:18:10 +0200 (MET DST) 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 UAA09769 for ; Mon, 23 Oct 2000 20:43:33 +0200 (MET DST) Received: from post.tepkom.ru (post.tepkom.ru [195.9.10.12]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id e9NIhVv03060 for ; Mon, 23 Oct 2000 20:43:32 +0200 (MET DST) Received: (from msk@localhost) by post.tepkom.ru (8.9.3/8.9.3) id WAA08441 for caml-list@pauillac.inria.fr.ANTIVIRUS; Mon, 23 Oct 2000 22:43:29 +0400 Received: from localhost (msk@localhost) by post.tepkom.ru (8.9.3/8.9.3) with ESMTP id WAA08415; Mon, 23 Oct 2000 22:43:28 +0400 X-Authentication-Warning: post.tepkom.ru: msk owned process doing -bs Date: Mon, 23 Oct 2000 22:43:28 +0400 (MSD) From: Anton Moscal To: Chris Hecker cc: Caml list 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++: There is no good solution. But may be the following can help you: type 'bar foo = B of 'bar ... type bar = F of bar foo Regards, Anton