Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: John Goerzen <jgoerzen@c...>
Subject: Re: [Caml-list] Dynamically evaluating OCaml code
On Thu, Apr 08, 2004 at 07:59:04PM +0200, Jean-Marc EBER wrote:
> >such a slice?  As far as I can tell, there are no standard functions for
> >any of Array or List to do that.  I could write a function for either of
> >them to loop over it and get me what I want, but the point is that this
> >functionality is useful.
> >
> In the time you wrote the previous paragraph, its also possible to write 
> following (of course horribly inefficient, because it inverts two times the 
> argument list) prototype implementation of the function you need, so that 

Not quite; the numbers 2 and 3 are not known in advance, but yes, I did
write a function to accomplish that anyway :-)

> 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...

Is switching a whole thing back and forth between lists and arrays
really efficient?  Like I've said before, arrays aren't so useable in
the non-imperitive sense, and notably I don't think they can be used in
match like x::xs for lists -- which is very useful all over the place.

-- John

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: