<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/e65211ea034261766209b913d033cd99"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-12T17:00:53"
  subject="Re: [Caml-list] Re: Regular expression matching against OCaml streams."
  prev="2009/01/8dbf9add071cbdba9d0de2236b19ec61"
  next="2009/01/bc50472cb112ab569f055bf50e480381"
  prev-in-thread="2009/01/ced6106d4b7a7fe4b8f03f95858134ad"
  prev-thread="2009/01/2549cd673119c567f7c38185b8f44404"
  next-thread="2009/01/d872246fc16e795f138c798f5c03dea4"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Regular expression matching against OCaml streams.">
<msg 
  url="2009/01/6d098a9e0587a2759e2b95fbcda926ab"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-12T13:00:58"
  subject="Regular expression matching against OCaml streams.">
<msg 
  url="2009/01/1a6bc2f9ffbdf3622a51b34217224e81"
  from="Edgar Friendly &lt;thelema314@g...&gt;"
  author="Edgar Friendly"
  date="2009-01-12T14:34:17"
  subject="Re: [Caml-list] Regular expression matching against OCaml streams.">
<msg 
  url="2009/01/ced6106d4b7a7fe4b8f03f95858134ad"
  from="Chris Conway &lt;cconway@c...&gt;"
  author="Chris Conway"
  date="2009-01-12T15:49:26"
  subject="Re: Regular expression matching against OCaml streams.">
<msg 
  url="2009/01/e65211ea034261766209b913d033cd99"
  from="Dmitri Boulytchev &lt;db@t...&gt;"
  author="Dmitri Boulytchev"
  date="2009-01-12T17:00:53"
  subject="Re: [Caml-list] Re: Regular expression matching against OCaml streams.">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>

&gt;&gt; I don't know of any libraries for this purpose.  I will warn anyone
&gt;&gt; making one that it's easy for simple regex matching to evaluate the
&gt;&gt; whole stream, and then fail to match.
&gt;&gt;     
&gt;
&gt; Or worse, never terminate. E.g.,
&gt;
&gt;     stream_match "a*b" (Stream.from (fun _ -&gt; Some 'a'))
&gt;   
    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.

</contents>

</message>

