Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
circular types?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-10-22 (19:41)
From: Vitaly Lugovsky <vsl@o...>
Subject: Re: circular types?
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 ( (UIN=45482254)