From: Nicolas C. <war...@fr...> - 2003-12-10 06:24:16
|
> Hi *, > > I was just looking through ocaml-lib and I've got a few contributions > you guys might be interested in: > > For ExtString: > > val split : string -> char -> int -> string list > val split_chars : string -> char list -> int -> string list > val strstr : string -> string -> int -> int > val ends_with : string -> string -> bool > val begins_with : string -> string -> bool Are theses not already in ExtString ? ( you need to look the documentation into ExtString.String module on the website, or edit the CVS version of extString.mli that might be up-to-date ) > These are the first things I did in ocaml because I pretty much can't > stand regex (and this is about 4x faster than doing the same with basic > regex). Looks like you've got some of that in CVS. > > I notice your todo list includes a wish for base64 support. I just > completed this: > > exception Invalid_encode_chunk of int > val char_map : char array > val stream_convert : string Stream.t -> char Stream.t > val encode_chunk : char list -> string > val encode_stream_chunk : char Stream.t -> int -> string option > val encode : char Stream.t -> string Stream.t > val encode_to_string : char Stream.t -> string > val encode_string : string -> string > > exception Invalid_decode_chunk of int > val char_index : int array > val is_base64_char : char -> bool > val decode_chunk : char list -> string > val decode : char Stream.t -> string Stream.t > val decode_to_string : char Stream.t -> string > val decode_string : string -> string > > ...I was getting ready to do url encoding and decoding as well in the > form of a CGI lib. Handling strings are char or int arrays is very inefficient, and Streams are not used in the Extlib. Please look at Enum modules and try to express your lists , arrays and streams as enums, this will make your code a lot more plugable into the Extlib. Regards, Nicolas Cannasse |