From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id BAC51BC0A for ; Wed, 4 Apr 2007 07:33:34 +0200 (CEST) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l345XWio032125 for ; Wed, 4 Apr 2007 07:33:33 +0200 X-IronPort-AV: E=Sophos;i="4.14,367,1170595800"; d="scan'208";a="106032524" Received: from ppp36-111.lns2.syd6.internode.on.net (HELO [192.168.1.201]) ([59.167.36.111]) by ipmail02.adl2.internode.on.net with ESMTP; 04 Apr 2007 14:58:24 +0930 Subject: Re: [Caml-list] Re: How important are circular lists/recursive objects? From: skaller To: Stefan Monnier Cc: caml-list@inria.fr In-Reply-To: References: Content-Type: text/plain Date: Wed, 04 Apr 2007 15:28:18 +1000 Message-Id: <1175664498.24614.5.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 461338AC.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursive:01 recursive:01 sml:01 ocaml's:01 abstraction:01 sourceforge:01 garbage:01 wrote:01 caml-list:01 functions:01 data:02 structures:02 rarely:02 functional:02 construct:02 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 suffice). -- John Skaller Felix, successor to C++: http://felix.sf.net