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 QAA20823; Thu, 29 Jul 2004 16:58:41 +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 QAA21382 for ; Thu, 29 Jul 2004 16:58:40 +0200 (MET DST) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6TEwcSH007986 for ; Thu, 29 Jul 2004 16:58:39 +0200 Received: (qmail 26559 invoked from network); 29 Jul 2004 14:58:37 -0000 Received: from shell1.speakeasy.net ([69.17.110.70]) (envelope-sender ) by mail4.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Jul 2004 14:58:37 -0000 Date: Thu, 29 Jul 2004 07:58:37 -0700 (PDT) From: brogoff To: Alex Baretta cc: Ocaml Subject: Re: [Caml-list] looping recursion In-Reply-To: <410898F0.6030804@baretta.com> Message-ID: References: <16646.64470.304530.264731@soggy.deldotd.com> <16647.5177.849829.421587@soggy.deldotd.com> <4107544C.4040502@baretta.com> <410898F0.6030804@baretta.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 4109109E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brogoff:01 brogoff:01 caml-list:01 recursion:01 baretta:01 caml-list:01 petty:01 whining:01 snob:01 hash:01 catenable:01 deques:01 deques:01 doubly:01 catenable:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 29 Jul 2004, Alex Baretta wrote: > brogoff wrote: > > Well, I'm still on the caml-list, so of course it isn't *that* bad. Also, as > > I said, if you need a tail recursive map over built in lists, you have at > > least two options. Unfortunately, my preference is to use Obj, which IMO > > points to a deficiency in the core language. Most, maybe all, of my issues > > with OCaml, amount to petty complaints, no showstoppers or dealbreakers. > > Hey, at least I'm not whining about the license! > > Yes, I guess we simply can live with it. I can't wait to have STL > iterators in Ocaml, but meanwhile I can live with this functional > nonsense: lists, maps, sets... ;) That's funny! I used to get chided by the guy who hired me for being a bit of a functional snob, always trying to find a side effect free solution (BTW, the "mutable" lists using Obj are side effect free) instead of solving every problem with a hash table :-) Some problems are just way easier to solve with imperative programming though. Have you ever taken a look at purely functional catenable deques? If you don't need persistence (if your deques are used in a single threaded manner that is) would you use those instead of the obvious doubly linked list implementation? That's not an abstract question either, catenable deques come up quite naturally when implementing some 2D computational geometry algorithms.I took a look at the latest algorithm by Kaplan and Tarjan and quickly realized that it was hugely complicated if persistence is not needed. > > > There are quite a few cases where singly linked lists are the most efficient > > data structure, and they're just right for the problem. Streams and laziness > > are not at all efficient in comparison. Stack overflow commonly happens whenm > > one of my users (yup, I have users of my code who aren't me ;-) decides to > > run on data much larger than I'd anticipated. > > Huge lists are usually not an efficient data structure. Sure, but sometimes you have programs which aren't intended to be used on huge data sets, but pesky users aren't deterred by your warnings. So, even if the extremely common case is not huge, it shouldn't fail in the huge case, unless of course the failure is Out_of_memory. -- 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