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 UAA32336; Thu, 8 Apr 2004 20:21:34 +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 UAA32435 for ; Thu, 8 Apr 2004 20:21:23 +0200 (MET DST) Received: from calmail-cl.berkeley.edu (mailfarm.Berkeley.EDU [128.32.61.106]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i38ILLYM025387 for ; Thu, 8 Apr 2004 20:21:22 +0200 Received: from [64.162.212.212] (HELO tallman.kefka.frap.net) by calmail-cl.berkeley.edu (CommuniGate Pro SMTP 4.1.8) with SMTP id 14616530; Thu, 08 Apr 2004 11:21:21 -0700 Received: by tallman.kefka.frap.net (sSMTP sendmail emulation); Thu, 8 Apr 2004 11:20:44 -0700 Date: Thu, 8 Apr 2004 11:20:44 -0700 From: Kenneth Knowles To: Jean-Marc EBER Cc: John Goerzen , Ocaml Mailing List Subject: Re: [Caml-list] Dynamically evaluating OCaml code Message-ID: <20040408182044.GA18551@tallman.kefka.frap.net> References: <20020104004356.GA1672@mev> <20040408133727.GC29195@excelhustler.com> <20040408145606.GA18473@fichte.ai.univie.ac.at> <20040408151427.GA740@redhat.com> <20040408152654.GB18473@fichte.ai.univie.ac.at> <20040408155833.GG30763@excelhustler.com> <407592E8.6080500@lexifi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <407592E8.6080500@lexifi.com> User-Agent: Mutt/1.5.6i X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; knowles:99 caml-list:01 dynamically:01 2004:99 helper:01 cleanliness:01 bottleneck:01 arrays:01 ocaml:01 caml:01 0200,:01 concise:01 trivial:01 complexity:02 complexity:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 171 On Thu, Apr 08, 2004 at 07:59:04PM +0200, Jean-Marc EBER wrote: > I don't need to mention that your previous particular problem is so trivial > that it could easily be expressed with arrays as a "one liner" of caml > code... Look at Array.sub... This is also a general principle - O'Caml is concise enough that a lot of helper functions you would expect in imperative scripting languages or C are too simple to include, for the sake of cleanliness. I certainly don't think the standard library is perfectly designed, but tiny list handling functions should be kept to a minimum (I even think the current List might have too many). By the way, list slicing has the same complexity as Array.of_list and then Array.sub so it is, in fact, in the standard library. Don't even bother talking about efficiency at a lower level than complexity of algorithms until you have a complete, profiled program - and of course you are talking about disk access so there's not a chance of the slicing being a bottleneck. Kenn ------------------- 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