English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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,