OOps! I guess X. Leroy is giving a strong hint *against* inefficient
code in the ExtLib... Anybody else reads it likewise?
> > in Haskell, strings are lists of chars.
> And what a horrible design decision that is!
Actually, the list representation of strings is so repugnant that I
don't even want to include "explode" and "implode" coercions between
string and char list in the standard library. A standard library
should steer users away from algorithmically-inefficient code. By not
having implode and explode in the library, I hope OCaml programmers
will come to the realization that the proper way to operate on strings
is either via block operations (the String module, regexps, etc), or
by recursion on integer indices.
- Xavier Leroy
fva [Monday 3 March 2003] :
> OOps! I guess X. Leroy is giving a strong hint *against*
> inefficient code in the ExtLib... Anybody else reads it likewise?
[ Sorry about last mail ... ]
I think it's OK to have inefficient code as long as the user is fully
aware he is using inefficient code and has good reasons to use it. The
point of representing string as char list is that you can apply it to
polymorphic functions that work for any list. Personally, I almost
never encountered such a situation.
So, IMHO, the important issue is that these functions are not very
useful; the fact that they are inefficient is only secondary. [But of
course this depends much on what kind of programs you write and I
guess some people really need this list representation.]
From: Nicolas Cannasse <warplayer@fr...> - 2003-03-04 01:31:31
> OOps! I guess X. Leroy is giving a strong hint *against* inefficient
> code in the ExtLib... Anybody else reads it likewise?
As I agree with Xavier point of view of not to provide functions in the
StdLib (and that goes as well for the ExtLib) that will give bad ideas of
programming to ocaml people, I have temporaly removed implode/explode for my
local ExtString module ( next version posted soon on this list ).