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 90AAFBC0A for ; Tue, 3 Apr 2007 08:58:55 +0200 (CEST) Received: from will.iki.fi (will.iki.fi [217.169.64.20]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l336wt5F001956 for ; Tue, 3 Apr 2007 08:58:55 +0200 Received: from [10.0.20.131] (fa-3-0-0.fw.exomi.com [217.169.64.99]) by will.iki.fi (Postfix) with ESMTP id A471060; Tue, 3 Apr 2007 09:58:54 +0300 (EEST) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: caml-list Content-Transfer-Encoding: 7bit From: Ville-Pertti Keinonen Subject: Re: [Caml-list] How important are circular lists/recursive objects? Date: Tue, 3 Apr 2007 09:58:59 +0300 To: Brian Hurt X-Mailer: Apple Mail (2.752.3) X-Miltered: at discorde with ID 4611FB2F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursive:01 recursive:01 2007,:98 closures:01 wrote:01 rec:01 rec:01 caml-list:01 functions:01 cyclic:01 data:02 lazy:02 lazy:02 structures:02 construct:02 On Apr 3, 2007, at 2:55 AM, Brian Hurt 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? Are you referring to all cases of let rec for non-functions, or just those that include "bare" self-references? Most of the cases I can think of involve closures (so they're not necessarily cyclic, merely self-referential), e.g. useful lazy lists can often be constructed with something like: let rec l = LazyList (1, lazy (do_something l))