Browse thread
recursive types
-
Jacques Le Normand
- Erik de Castro Lopo
- Erik de Castro Lopo
- Jeremy Yallop
- Remi Vanicat
[
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: | Erik de Castro Lopo <erikd@m...> |
| Subject: | Re: [Caml-list] recursive types |
Jacques Le Normand wrote:
> hello again list
> is it possible to have mutually recursive classes and types?
Yes and yes.
I haven't played much with classes at all, but recursive types
can be defined as :
type x_t =
{ x : int ; y : y_t ; }
and
y_t =
{ z : string }
For recursive classes I beleive that you do
class xxx = ....
and yyy =
to define mutually recursive classes xxx and yyy.
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Think of XML as Lisp for COBOL programmers.
-- Tony-A (some guy on /.)