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 RAA21428; Fri, 8 Oct 2004 17:13:49 +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 RAA21417 for ; Fri, 8 Oct 2004 17:13:48 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from wetware.com (wetware.wetware.com [199.108.16.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i98FDldC031991 for ; Fri, 8 Oct 2004 17:13:48 +0200 Received: from [208.177.152.17] (helo=[10.0.1.2]) by wetware.com with esmtp (Exim 4.20) id 1CFwRD-0005rf-2i for caml-list@inria.fr; Fri, 08 Oct 2004 08:13:43 -0700 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <41669EAA.7000509@tni-software.com> References: <41669437.3010201@yahoo.it> <41669EAA.7000509@tni-software.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: james woodyatt Subject: Re: [Caml-list] Recursive lists Date: Fri, 8 Oct 2004 08:13:43 -0700 To: Caml List X-Mailer: Apple Mail (2.619) X-Miltered: at nez-perce with ID 4166AEAB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; woodyatt:01 jhw:01 wetware:01 caml-list:01 furic:01 buffer:01 delivers:99 seq:01 ocamldoc:01 dependencies:01 ocamlfind:01 sigterm:01 woodyatt:01 jhw:01 wetware:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 08 Oct 2004, at 07:05, S=E9bastien Furic wrote: > Luca Pascali wrote: >> Can some functions of the List library support the use of the=20 >> recursive lists? >> I mean: can some scanning functions such as map, for_all, exists,=20 >> mem, filter, and so on understand if they are working on recursive=20 >> lists and act correctly without going in buffer overflow or infinite=20= >> loops? >> Did anyone already have a similar needing? And in which way did=20 >> he/she work? >> Thanks in advance to anyone >> Luca > > You can use lazy lists to solve the problem. A lazy list delivers its=20= > elements on demand so you can manipulate infinite lists safely=20 > provided you don't print their whole contents for instance... > See http://caml.inria.fr/archives/200304/msg00280.html to see how to=20= > implement them (they're not present in the OCaml distribution). My Cf library (in the OCNAE project on SF.Net) contains a full suite of=20= functions for constructing and manipulating lazy lists (the Cf_seq=20 module). It also contains lots of other goodies. The code has BSD=20 license, is documented with Ocamldoc, and has no dependencies on=20 anything other than Markus Mottl's Ocamlfind (for building and=20 installing). (Note: you can even print the contents of an infinite lazy list if it's=20= the last thing your program does before it receives SIGINT or SIGTERM,=20= e.g. when printing to a pipe connected to the input of another=20 program.) --=20 j h woodyatt markets are only free to the people who own them.= ------------------- 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