[chuck-users] chout and cherr confuse me [BUG?]

Kassen signal.automatique at gmail.com
Wed Oct 21 04:59:00 EDT 2009

Hi, Ge!

> In short, chout prints to stdout (buffered output, higher performance), and
> cherr prints to stderr (more timely and synchronous, handled differently by
> console/pipes/redirect).  The existing <<< >>> operators prints to stderr by
> default (there was actually no way to print to stdout before chout).
Check, that's quite clear then.

> If one desires truly synchronous output, then cherr is probably the way to
> go.  At the same time, there are a few nuances of cout (C++) - there is a
> method to force flushing the buffer - this actually exists for chout - just
> invoke .flush().  Inserting an "endl" into C++ cout effectively flushes the
> output stream - this is currently not implemented.  I've made
> this addition in CVS (IO.newline() or "\n" by itself will cause a flush on
> chout), and this should be in the next release.
> Well.... now I have a new issue;


...will crash the Mini for me. It even crashes when that's the only line in
the file.

I'm also sorry to have to say that I'm still not sold on the idea that chout
works properly. I can accept it being slow but here it is being slow in a
very predictable way that's related to what ChucK does. Especially as
IO.newline() doesn't seem to -by itself- flush all data out. If you look at
my example code you'll see all print commands use newline() yet at the end
of running the file there is still a print command up in limbo.

Sorry to persist like this.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20091021/3750d4ec/attachment-0001.html>

More information about the chuck-users mailing list