caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Recursive class+type definitions
@ 2007-07-16  1:29 Raj B
  2007-07-16  2:00 ` [Caml-list] " Jon Harrop
  2007-07-16  2:27 ` Chris King
  0 siblings, 2 replies; 5+ messages in thread
From: Raj B @ 2007-07-16  1:29 UTC (permalink / raw)
  To: caml-list

Hi all

Can we have mutually recursive definitions mixing types and classes?  
For example, I want to define
a class called mypoint, which contains another data structure (say, a  
custom list) of mypoints.

class virtual mypoint =
	object
		method virtual getx : float
		method virtual getlist : mypointlist
	end

type mypointlist = Empty | Cons of (mypoint * mypointlist)

What is the best way to achieve this kind of mutual recursion?

Thanks
Raj


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Recursive class+type definitions
@ 2007-07-18 10:22 Christopher Cramer
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Cramer @ 2007-07-18 10:22 UTC (permalink / raw)
  To: caml-list

I wrote a bit on this on my blog a while back.

http://yumegakanau.org/blog/2007/05/23/


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

end of thread, other threads:[~2007-07-18 10:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-16  1:29 Recursive class+type definitions Raj B
2007-07-16  2:00 ` [Caml-list] " Jon Harrop
2007-07-16  2:27 ` Chris King
2007-07-16  9:00   ` Jacques GARRIGUE
2007-07-18 10:22 Christopher Cramer

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).