From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA15959; Fri, 8 Oct 2004 15:32:08 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA15947 for ; Fri, 8 Oct 2004 15:32:07 +0200 (MET DST) Received: from mta1.cl.cam.ac.uk (mta1.cl.cam.ac.uk [128.232.0.15]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i98DW7XH018415 for ; Fri, 8 Oct 2004 15:32:07 +0200 Received: from zonule.cl.cam.ac.uk ([128.232.9.23] helo=cl.cam.ac.uk ident=[XJVJZNpLaDcF4J2mfwVZDCcIAkeSiUBY]) by mta1.cl.cam.ac.uk with esmtp (Exim 3.092 #1) id 1CFuqr-0000uk-00; Fri, 08 Oct 2004 14:32:05 +0100 X-Mailer: exmh version 2.6.3-CL 04/04/2003 with nmh-1.0.4 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: cslists/caml To: Luca Pascali cc: caml-list@inria.fr Subject: Re: [Caml-list] Recursive lists In-reply-to: Your message of "Fri, 08 Oct 2004 15:20:55 +0200." <41669437.3010201@yahoo.it> Mime-Version: 1.0 Content-Type: text/plain Date: Fri, 08 Oct 2004 14:31:54 +0100 From: Keith Wansbrough Message-Id: X-Miltered: at nez-perce with ID 416696D7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 buffer:01 equality:01 exists:01 overflow:02 nodes:02 node:02 recursive:03 recursive:03 library:03 data:03 infinite:05 functions:05 functions:05 mean:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Can some functions of the List library support the use of the recursive > lists? > I mean: can some scanning functions such as map, for_all, exists, mem, > filter, and so on understand if they are working on recursive lists and > act correctly without going in buffer overflow or infinite loops? How could they do this? It's just a list; there's nothing special about it, except that it has no end. You might be able to do it by keeping a list of all the nodes you've visited, and using physical equality to check if you have already visited a node. But it would be better to design a more appropriate data structure for your application, one for which such tricks are not needed. What are you trying to do? --KW 8-) ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners