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 PAA15332; Fri, 8 Oct 2004 15:20:58 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA15316 for ; Fri, 8 Oct 2004 15:20:57 +0200 (MET DST) Received: from smtp004.mail.ukl.yahoo.com (smtp004.mail.ukl.yahoo.com [217.12.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id i98DKuJP020209 for ; Fri, 8 Oct 2004 15:20:56 +0200 Received: from unknown (HELO yahoo.it) (pasckosky@213.255.109.130 with plain) by smtp004.mail.ukl.yahoo.com with SMTP; 8 Oct 2004 13:20:56 -0000 Message-ID: <41669437.3010201@yahoo.it> Date: Fri, 08 Oct 2004 15:20:55 +0200 From: Luca Pascali User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] Recursive lists Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41669438.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; buffer:01 baretta:01 baretta:01 she:98 rec:01 rec:01 exists:01 overflow:02 overflow:02 370:97 370:97 stack:02 recursive:03 recursive:03 library:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi everyone. I have a little question about the recursive lists. In an application I needed to use a list composed by some elements (placed in the head of the list) and recursive element, like let rec_list = let rec l2 = 100 :: l2 in [1;2;3;4;5] @ l2 in order to have the last elements periodically repeated. In a list like this, I found that the map function goes in stack overflow. It seems that it is not aware of the recursive characteristics of the input list. I had to write a version of the map function to support this in my software (I have to finalize something before posting it). My questions are: 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? Did anyone already have a similar needing? And in which way did he/she work? Thanks in advance to anyone Luca -- ********************************************************************* Luca Pascali pasckosky2000@yahoo.it luca@barettadeit.com asxcaml-guru@barettadeit.com http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. 02 370 111 55 fax. 02 370 111 54 Our technology: http://www.asxcaml.org/ http://www.freerp.org/ ------------------- 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