caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitri Boulytchev <db@tepkom.ru>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Regular expression matching against OCaml streams.
Date: Mon, 12 Jan 2009 19:59:55 +0300	[thread overview]
Message-ID: <496B770B.4040205@tepkom.ru> (raw)
In-Reply-To: <loom.20090112T154624-248@post.gmane.org>


>> 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 
string
you must be ready to fail. And if you are dealing with infinite data 
structures
you must be ready not to terminate. At least these arguments did not 
prevent OCaml
developers from implementing neither Stream nor, for example, 
Lexing.from_function,
which definitely may be used to reproduce these malicious cases :)

    Best regards,
    DB.


      reply	other threads:[~2009-01-12 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 13:00 Dmitri Boulytchev
2009-01-12 14:34 ` [Caml-list] " Edgar Friendly
2009-01-12 15:49   ` Chris Conway
2009-01-12 16:59     ` Dmitri Boulytchev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496B770B.4040205@tepkom.ru \
    --to=db@tepkom.ru \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).