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
Regular expression matching against OCaml streams.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-12 (17:00)
From: Dmitri Boulytchev <db@t...>
Subject: Re: [Caml-list] Re: Regular expression matching against OCaml streams.

>> I don't know of any libraries for this purpose.  I will warn anyone
>> making one that it's easy for simple regex matching to evaluate the
>> whole stream, and then fail to match.
> Or worse, never terminate. E.g.,
>     stream_match "a*b" (Stream.from (fun _ -> Some 'a'))
    I do not see the problem in either case. If you has to match a long 
you must be ready to fail. And if you are dealing with infinite data 
you must be ready not to terminate. At least these arguments did not 
prevent OCaml
developers from implementing neither Stream nor, for example, 
which definitely may be used to reproduce these malicious cases :)

    Best regards,