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 EAA24098; Wed, 28 Jul 2004 04:49:46 +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 EAA23487 for ; Wed, 28 Jul 2004 04:49:45 +0200 (MET DST) From: briand@aracnet.com Received: from jade.spiritone.com (jade.spiritone.com [216.99.193.136]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6S2nhEV006520 for ; Wed, 28 Jul 2004 04:49:44 +0200 Received: from soggy.deldotd.com (216-99-206-32.cust.aracnet.com [216.99.206.32]) by jade.spiritone.com (8.12.8/8.12.8) with ESMTP id i6S2nU2v011128; Tue, 27 Jul 2004 19:49:30 -0700 Received: from briand by soggy.deldotd.com with local (Exim 3.36 #1 (Debian)) id 1BpeVV-0000X4-00; Tue, 27 Jul 2004 19:49:29 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16647.5177.849829.421587@soggy.deldotd.com> Date: Tue, 27 Jul 2004 19:49:29 -0700 To: Brian Hurt Cc: John Prevost , Ocaml Mailing List Subject: Re: [Caml-list] looping recursion In-Reply-To: References: <16646.64470.304530.264731@soggy.deldotd.com> X-Mailer: VM 6.92 under Emacs 21.2.1 X-Miltered: at nez-perce with ID 41071447.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 recursion:01 extlib:01 sourceforge:01 drop-in:01 tweaks:01 inclined:01 writes:01 lazy:02 classic:03 library:03 data:03 data:03 scheme:03 elegant:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "Brian" == Brian Hurt writes: Brian> Take a look at ExtLib: Brian> http://sourceforge.net/projects/ocaml-lib/ thanks for the link. Brian> This contains a drop-in compatible replacement to the List Brian> library, which includes a List.map function that doesn't blow Brian> up. Brian> If your list is that long, I'd actually recommend doing one Brian> of two things: it really is. although I'd actually like it to be an array. it's the classic situation, read whole file - iterate on elements. easy to do in a list since I don't need to know the size. some minor tweaks and I can include the size in a data file and just fill an array directly. however, my larger point is the fact that the "standard" map blows up like that. as a long time scheme user I just find that plain weird. Now Everybody else seems to think I'm weird because I think that's weird ;-) Brian> Very long lists are a sign that you're using the wrong data Brian> structure. I'm not sure I understand that. I have 10^6 data points to work on. I'm thinking a list or an array is the right data structure. Although an array is more right. I mean if you are not worried about efficiency then incremental transformation by map'ing is a very elegant and clean way to go about doing that sort of work. Part of the problem is that powerful computers make for lazy programmers :-) It's just so easy to read the 10^6 elements into a list and then just keep map'ing them to the final value when it only takes seconds to do :-) If it took 2 minutes I'd be more inclined to think about the problem. Brian ------------------- 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