caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: Recursive class+type definitions
@ 2007-07-18 10:22 Christopher Cramer
  0 siblings, 0 replies; 2+ 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] 2+ messages in thread

* Recursive class+type definitions
@ 2007-07-16  1:29 Raj B
  0 siblings, 0 replies; 2+ 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] 2+ messages in thread

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 10:22 Recursive class+type definitions Christopher Cramer
  -- strict thread matches above, loose matches on Subject: below --
2007-07-16  1:29 Raj B

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