<?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="2003/12/6ca04e3679ec1004184b76bd53774151"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-12-09T19:15:21"
  subject="Re: [Caml-list] stream conversion"
  prev="2003/12/9947980da386f0a0a076c97377241cae"
  next="2003/12/5c54ecb9bfb3b517c0719bf7c74d646a"
  prev-in-thread="2003/12/9947980da386f0a0a076c97377241cae"
  next-in-thread="2003/12/9ee9052e21abd29b23b1757d11f1890b"
  prev-thread="2003/12/138d25e04135c86384c9d95218fd7b00"
  next-thread="2003/12/336da68464ef2651ac3a251d0d53f270"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] stream conversion">
<msg 
  url="2003/12/3ae47766c120e8d93ed0b4d9330f4667"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-12-09T07:56:15"
  subject="[Caml-list] stream conversion">
<msg 
  url="2003/12/8625cd8b15d41a5025c1435d3710629d"
  from="Remi Vanicat &lt;remi.vanicat@l...&gt;"
  author="Remi Vanicat"
  date="2003-12-09T12:07:57"
  subject="Re: [Caml-list] stream conversion">
<msg 
  url="2003/12/bc9dc2b12a47d4bcfa85daeb30c1aa27"
  from="Jean-Baptiste Rouquier &lt;jean-baptiste.rouquier@e...&gt;"
  author="Jean-Baptiste Rouquier"
  date="2003-12-09T16:58:50"
  subject="Re: [Caml-list] stream conversion">
<msg 
  url="2003/12/bac10dac5f02b6339a9ca9189c75cddc"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-12-09T17:25:29"
  subject="Re: [Caml-list] stream conversion">
<msg 
  url="2003/12/95d033f811e1ab445412e643be3da233"
  from="Jean-Baptiste Rouquier &lt;jean-baptiste.rouquier@e...&gt;"
  author="Jean-Baptiste Rouquier"
  date="2003-12-09T17:40:23"
  subject="Re: [Caml-list] stream conversion">
</msg>
<msg 
  url="2003/12/5c54ecb9bfb3b517c0719bf7c74d646a"
  from="Tim Freeman &lt;tim@f...&gt;"
  author="Tim Freeman"
  date="2003-12-09T19:43:51"
  subject="Re: [Caml-list] stream conversion">
<msg 
  url="2003/12/7705bdf1a3ecb740b46d00b434db07f4"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-12-16T22:41:15"
  subject="Re: [Caml-list] stream conversion">
</msg>
</msg>
</msg>
<msg 
  url="2003/12/9947980da386f0a0a076c97377241cae"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-12-09T19:13:29"
  subject="Re: [Caml-list] stream conversion">
</msg>
</msg>
<msg 
  url="2003/12/6ca04e3679ec1004184b76bd53774151"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-12-09T19:15:21"
  subject="Re: [Caml-list] stream conversion">
</msg>
</msg>
<msg 
  url="2003/12/9ee9052e21abd29b23b1757d11f1890b"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-12-10T01:09:52"
  subject="Re: [Caml-list] stream conversion">
</msg>
</msg>
</thread>

<contents>

On Dec 9, 2003, at 4:08, Remi Vanicat wrote:

&gt; why do you use Stream.empty ? it would be more natural to use only
&gt; Stream.next. As in :
&gt; let stream_convert source =
&gt;   let chunk = ref (Stream.of_string (Stream.next source)) in
&gt;   Stream.from (fun x -&gt;
&gt;     try
&gt;       Some (Stream.next !chunk)
&gt;     with
&gt;       Stream.Failure -&gt;
&gt;        (* code needed when the chunk is empty *)
&gt;     )

	I think I considered that, but didn't explore that direction for some 
reason.  I'll give that a shot.  Overall, I'm looking for a bit less 
duplication.  It just seems like the whole thing should be smaller, so 
I assume there's a better way.

&gt; By the way, your code make the assumption that no string in the source
&gt; stream are empty (look at what would happen in such case).

	Well, I believe that I will have no empty streams in my use case, but 
that's no excuse.

	Thanks for the pointers.

-- 
Dustin Sallings

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

