I understand (perhaps incorrectly) that Xavier rewrote the
code for this module, and assume the underlying functionality
is re-entrant?
For compatibility the old broken interface is still available,
which is fine, but a re-entrant interface should be provided.
IMHO. It's disgusting, having a library like this in a functional
programming language. Even Python gets this right.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
When someone designs a new interface to Str and gets it approved by a
few respectable members of this community. A proof-of-concept
implementation wouldn't hurt either, although I'm OK with writing the
final implementation. It's the API for which I don't have ideas.
> I understand (perhaps incorrectly) that Xavier rewrote the
> code for this module, and assume the underlying functionality
> is re-entrant?
Correct.
- Xavier Leroy
What about this:
This is the reentrant API used in Ocamlnet. Once upon a time it was
really based on Str as backend, but we switched to Pcre for its extended
capabilities. The core idea is that code like
if Str.string_match re s 0 then
let u = Str.matched_group 1 s in
do_this
else
do_something_else
is replaced by
match Str.string_match re s 0 with
Some m ->
let u = Str.matched_group m 1 s in
do_this
| None ->
do_something_else
which is not very much longer. All intermediate state is kept in m.
Gerd
--
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
ge...@gerd-stolpmann.de http://www.gerd-stolpmann.de
Phone: +49-6151-153855 Fax: +49-6151-997714
------------------------------------------------------------
Ah, this is all good news! A proof of concept could probably
be trivially implemented, just using the old interface.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
_______________________________________________