English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2002-08-30 (12:37)
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

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

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