Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Dynamically evaluating OCaml code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kenneth Knowles <kknowles@b...>
Subject: Re: [Caml-list] Dynamically evaluating OCaml code
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