From: fva <fv...@ts...> - 2003-03-03 15:44:07
|
OOps! I guess X. Leroy is giving a strong hint *against* inefficient code in the ExtLib... Anybody else reads it likewise? Regards, Fran Valverde > > in Haskell, strings are lists of chars. > > And what a horrible design decision that is! Agreed. 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 |
From: Olivier A. <an...@ij...> - 2003-03-03 16:10:55
|
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? |
From: Olivier A. <an...@ij...> - 2003-03-03 16:27:48
|
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.] -- Olivier |
From: Nicolas C. <war...@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 ). Nicolas Cannasse |