Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
How important are circular lists/recursive objects?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-04 (05:33)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Re: How important are circular lists/recursive objects?
On Tue, 2007-04-03 at 23:52 -0400, Stefan Monnier wrote:
> > The question is: if this behavior was completely outlawed, and either you
> > couldn't build up circular lists/recursive data structures of this type at
> > all, or had to call special functions (List.circularize, say), to create
> > them, would this be a signifigant problem?  Does anyone actually use this
> > construct, and if so, for what?
> This is the case in SML: you need to go through a `ref' cell in order to
> create a cycle.  This has very rarely been presented as
> a serious limitation.  OCaml's trick is occasionally useful, but I don't
> think anybody would lose her sleep over it.

You can also create cycles using functional abstraction (otherwise
a pure FPL wouldn't need a garbage collector, ref counting would

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: