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

Ge Wang ge at ccrma.Stanford.EDU
Wed Oct 21 05:10:03 EDT 2009


Hi Kassen!

>       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;
> 
> chout.flush();
> 
> ...will crash the Mini for me. It even crashes when that's the only 
> line in the file.

Oh yes, that is indeed an issue (with ChucK, not mini) - working on it 
now!

> 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.

As I expressed in my last email, IO.newline() is currently NOT causing
a flush (as it should).  I've fixed this issue in CVS, and we will 
release it in the next version.  Hopefully we can fix the flush issue as 
well, and things should be better then!

> Sorry to persist like this.

Hah - you and I both know this is how we make ChucK suck less!
(and you've uncovered two bugs already here!)

Thanks for the persistence and rock on!

All the best,
Ge!


More information about the chuck-users mailing list