<?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="2002/12/7b41bb2cf02f08cdbe03c5ca5733063b"
  from="Yang Shouxun &lt;yangsx@f...&gt;"
  author="Yang Shouxun"
  date="2002-12-23T01:16:51"
  subject="[Caml-list] strange behaviors with output"
  prev="2002/12/d76d262db92b1fcc50d34d48cfe88233"
  next="2002/12/cf73fe7aa5b8a63f177454cd42eff512"
  next-in-thread="2002/12/cf73fe7aa5b8a63f177454cd42eff512"
  prev-thread="2002/12/91aa7b1a95c3d3276c4f02d438ab4a82"
  next-thread="2002/12/760539af03625c1d2af3b423714355e5"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] strange behaviors with output">
<msg 
  url="2002/12/7b41bb2cf02f08cdbe03c5ca5733063b"
  from="Yang Shouxun &lt;yangsx@f...&gt;"
  author="Yang Shouxun"
  date="2002-12-23T01:16:51"
  subject="[Caml-list] strange behaviors with output">
<msg 
  url="2002/12/cf73fe7aa5b8a63f177454cd42eff512"
  from="Yang Shouxun &lt;yangsx@f...&gt;"
  author="Yang Shouxun"
  date="2002-12-23T02:31:36"
  subject="Re: [Caml-list] strange behaviors with output">
</msg>
<msg 
  url="2002/12/b223d0edf61490d3f9d2c5dcae8f3590"
  from="Michaël_Grünewald &lt;michael-grunewald@w...&gt;"
  author="Michaël_Grünewald"
  date="2002-12-26T15:15:10"
  subject="[Caml-list] Re: strange behaviors with output">
</msg>
</msg>
</thread>

<contents>
Hi,

I found a strange behavior when compiling and running a simple ocaml program.  
When the file to process (a testing case) is small, it works as expected. But 
when the file (the real case) is very large, it does not. For instance, if 
the expected output should be:
----8&lt;----
a
b
c
d
...
----8&lt;----
What I get may be:
----8&lt;----
a
d
c
b
...
----8&lt;----

That is to say, when the input file is large, every now and then the output 
sequences of lines will be reversed.

Another point is that the program consumes a lot of memory, so much so that 
when the input file is very big the progam gets killed by the OS. Actually 
the program should consume very small memory. 

What I'm trying to do is:
----8&lt;----
initialize result
read one line from the input file 
comparing it to the last line
if test condition true
  update result
  read next line
else 
  print the result and flush stdout
----8&lt;----

I'm using ocaml on Debian. It's the latest from sid.
Any ideas?

TIA!
shouxun
-------------------
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>

