caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* mutually dependent class and type
@ 2008-09-25 22:24 Sébastien Hinderer
  2008-09-25 23:41 ` [Caml-list] " Martin Jambon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sébastien Hinderer @ 2008-09-25 22:24 UTC (permalink / raw)
  To: caml-list

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, but is there a way to
express it ?

Many thanks in advance for your help,
Sébastien.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-05 13:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-25 22:24 mutually dependent class and type Sébastien Hinderer
2008-09-25 23:41 ` [Caml-list] " Martin Jambon
2008-09-26  6:40 ` Tim Rentsch
2008-10-05 13:31 ` Yann Régis-Gianas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).