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 SAA16629; Mon, 11 Oct 2004 18:24:23 +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 SAA16646 for ; Mon, 11 Oct 2004 18:24:22 +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 concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i9BGOLSB016652 for ; Mon, 11 Oct 2004 18:24:22 +0200 Received: from [208.177.152.17] (helo=[10.0.1.2]) by wetware.com with esmtp (Exim 4.20) id 1CH2yC-0007KW-Ky for caml-list@inria.fr; Mon, 11 Oct 2004 09:24:20 -0700 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <416A8CDA.7060407@univ-savoie.fr> References: <41669437.3010201@yahoo.it> <4166A395.70301@yahoo.fr> <4166DC42.3090602@baretta.com> <16746.15832.409677.764564@gargle.gargle.HOWL> <416A8CDA.7060407@univ-savoie.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <00F89380-1BA2-11D9-B4CE-000A958FF2FE@wetware.com> Content-Transfer-Encoding: 7bit From: james woodyatt Subject: Re: [Caml-list] About Obj (was Recursive lists) Date: Mon, 11 Oct 2004 09:24:19 -0700 To: Caml List X-Mailer: Apple Mail (2.619) X-Miltered: at concorde with ID 416AB3B5.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 38,:01 raffalli:01 filliatre:01 sensibly:01 immutable:01 immutable:01 woodyatt:01 jhw:01 wetware:01 christophe:01 mutable:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 11 Oct 2004, at 06:38, Christophe Raffalli wrote: > Jean-Christophe Filliatre wrote [quite sensibly]: >> >> [...] >> This shouldn't be advised, and not even posted on this list. > > And how do you write a tail recursive map doing only one structure > traversal (which is important with the penalty for memory access) on > immutable list without the Obj module ? By using a more appropriate data structure, e.g. a lazy list. It's a pay-me-now-or-pay-me-later sort of game you're playing here. Rather than whack on the immutable list, maybe you should consider doing this: type 'a mlist = N | C of 'a mcell and 'a mcell = { mutable cdr: 'a; mutable car: 'a mlist } No need to thank me. -- 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