Re: [Caml-list] mutually dependent class and type

2008-09-26 Thread Tim Rentsch
Date: Fri, 26 Sep 2008 00:24:39 +0200 From: =?iso-8859-1?Q?S=E9bastien?= Hinderer [EMAIL PROTECTED] Is there a (clean) way to define simultaneously a class and a type that are mutually recursive ? Something like this : class element (c : content) = object ... end and type

[Caml-list] mutually dependent class and type

2008-09-25 Thread Sébastien Hinderer
Dear list, Is there a (clean) way to define simultaneously a class and a type that are mutually recursive ? Something like this : class element (c : content) = object ... end and type content = | Data of string | Elements of element list;; This is of course not a valid OCaml definition,

Re: [Caml-list] mutually dependent class and type

2008-09-25 Thread Martin Jambon
On Fri, 26 Sep 2008, Sébastien Hinderer wrote: Dear list, Is there a (clean) way to define simultaneously a class and a type that are mutually recursive ? I don't think so, but you don't have to. Something like this : class element (c : content) = object ... end and type content = | Data