Browse thread
circular types?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| 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 (http://ontil.ihep.su/~vsl) (UIN=45482254)