Dear Kas,<br><br>I fear that this has to do with buffering (whether a stream is buffered or not), and if buffered, buffer size makes a difference, too.<br><br>For example, in C/C++, if you want to see the output of a fprintf() call for sure, you have to call fflush(). I don&#39;t know if it has a ChucK equivalent, though.<br>
<br>Szilveszter aka Hillaby<br><br><div class="gmail_quote">2009/10/20 Kassen <span dir="ltr">&lt;<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Fellow ChucKists,<br><br>Consider this edit of one of the new examples, I just made this because I was trying to figure out the difference between chout and cherr and why the plain example&#39;s output had the order in which the results of the operations were printed reversed;<br>

---------------------8&lt;--------------------------<br>// &#39;chout&#39; is chuck out, pronounced &quot;shout&quot;<br>// &#39;cherr&#39; is chuck err, pronounced &quot;Cher&quot;<br><br>// output to console on stdout<br>

chout &lt;= 1 &lt;= &quot; foo &quot; &lt;= 5.5 &lt;= IO.newline();<br><br>// output to console on stderr<br>cherr &lt;= 2 &lt;= &quot; bar &quot; &lt;= 5.5 &lt;= IO.newline();<br><br>&lt;&lt;&lt;&quot;start pause&quot;&gt;&gt;&gt;;<br>

second =&gt; now;<br>&lt;&lt;&lt;&quot;end pause&quot;&gt;&gt;&gt;;<br><br>// output to console on stderr<br>cherr &lt;= 3 &lt;= &quot; bar &quot; &lt;= 5.5 &lt;= IO.newline();<br><br><br>// output to console on stdout<br>

chout &lt;= 4 &lt;= &quot; foo &quot; &lt;= 5.5 &lt;= IO.newline();<br>-----------------------------8&lt;--------------------------------------<br><br>Now, the output this gives varies with how many times we used the various commands in the recent past and on what, but it stabilises to this after running it a few times;<br>

<br>[chuck](VM): sporking incoming shred: 1 (*<a href="http://chout.ck" target="_blank">chout.ck</a>)...<br>2 bar 5.5<br>&quot;start pause&quot; : (string)<br>4 foo 5.5<br>1 foo 5.5<br>&quot;end pause&quot; : (string)<br>
3 bar 5.5<br><br>
It seems to me that chout has some sort of internal buffer and that it takes two chout commands to reach the actual console, instead of one, like I expected. It also seems like cherr has a higher priority of some sort. maybe cherr commands print immediately while chout ones are delayed until time is advanced? <br>

<br>I&#39;d like to know what the intended behaviour is as I&#39;m now just guessing about the difference between the two. Right now I&#39;m leaning towards suspecting at least a bug in chout.<br><br>Yours,<br>Kas.<br>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br>