Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Str.string_match raising Invalid_argument "String.sub" in gc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus@m...>
Subject: Re: [Caml-list] Str.string_match raising Invalid_argument "String.sub" in gc
On Wed, 22 Aug 2001, wrote:
> Hi, I'm converting over some examples from the Perl cookbook to learn
> OCaml and help with the PLEAC project <>,
> and I'm running into some strange behavior with the Str structure;
> I think it's something to do with garbage collection.

I think it might be more suitable to translate the PLEAC-examples to
OCaml using the PCRE-library (Perl Compatible Regular Expressions):
it's much easier to get things right (e.g. no problems with evaluation
order as you just had - the PCRE is stateless). You also don't have
to think Emacs-style with regular expressions. Furthermore, Perl
supports regexp features that are not available in the Str-module:
without the PCRE-library you'd have to write significantly more code
for some PLEAC-examples.

You can find the PCRE-library here:

Best regards,
Markus Mottl

Markus Mottl                                   
Austrian Research Institute
for Artificial Intelligence        
Bug reports:  FAQ:
To unsubscribe, mail  Archives: