Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Recursive type and class
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Frese <dfrese@d...>
Subject: [Caml-list] Recursive type and class
Hello folks,

I have a problem with mixing a class and a type recursively. Written
down directly, I want to have something like this:

type atype = Obj of aclass | I of int

class aclass = object
  val mutable field0 : atype = I 5
end

But this does not work, of course. Can anyone tell me, how this can be
done?

Thanks, David.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners