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: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Dynamically evaluating OCaml code
On Thu, Apr 08, 2004 at 04:56:06PM +0200, Markus Mottl wrote:
> Yes, it's hard to do this with the current standard library.  The question
> is: who needs these functions anyway?  I can't remember ever having felt
> a need for them.

My "private library" defines:

val first : int -> 'a list -> 'a list

which returns the first n members of a list.  As for slicing the
middle from a list, I tend to think that the original poster should
probably be using a different, more suitable structure.  Perhaps an
Array if he wants random access.

> > Yes, I could write functions to do all of this, but my point is that
> > I shouldn't have to.
> 
> The point of the standard library is not to have a function for every
> imaginable problem but to have ones that cover standard problems.

Well, having a broad library helps to implement things.  For example,
LWP-like functionality [in perl4caml] makes writing scripts which
analyse websites an awful lot simpler.  Having functions which allow
me to convert from Y/M/D to ISO-standard years and weeks [which I have
written] makes writing business analysis functions more tractable.
Perl and Python have all this stuff, which makes it much easier to
implement these sorts of boring businessy programs.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
Perl4Caml lets you use any Perl library in your type-safe Objective
CAML programs. http://www.merjis.com/developers/perl4caml/

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