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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 08AB4BC6B for ; Tue, 3 Apr 2007 01:55:54 +0200 (CEST) Received: from bsd4.nyct.net (mail-out4.nyct.net [216.139.141.4]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l32NtqLx008935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 3 Apr 2007 01:55:53 +0200 Received: from [192.168.42.2] ([216.139.135.144]) by bsd4.nyct.net (8.13.4/8.13.4) with ESMTP id l32NtkQV074836 for ; Mon, 2 Apr 2007 19:55:47 -0400 (EDT) (envelope-from bhurt@spnz.org) Date: Mon, 2 Apr 2007 19:55:53 -0400 (EDT) From: Brian Hurt X-X-Sender: bhurt@localhost To: caml-list Subject: How important are circular lists/recursive objects? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 46119808.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursive:01 ocaml:01 recursive:01 rec':01 rec:01 rec:01 functions:01 right-hand:01 define:01 data:02 data:02 expression:02 structures:02 structures:02 construct:02 In Ocaml you have some ability to define recursive data structures. The classic example of this is the circular list: let rec example = 1 :: 2 :: example;; There are obvious limitations to this sort of trick: # let rec example = List.map (fun x -> x + 1) (1 :: 2 :: example);; This kind of expression is not allowed as right-hand side of `let rec' # 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? Brian