Forgetting parenthesis in function calls yields no error
Hello list! I just spent a little time scratching my head over these little functions: fun void startRecording() { <<< "Record! ", index >>>; true => lisaLeft.record; true => lisaRight.record; } fun void toggle() { !active => active; paintActive(); if (active) { startRecording; } } Everything seemed to be in order, I added a lot of print statements, and could for the life of me figure out why the startRecording function wasn't executed from toggle(). There was no error message, everything seemed to be in order. Then I peered more closely and saw that I had forgotten to put parenthesis in the function call: startRecording(); After that everything started working. My question is: shouldn't a function name all by itself result in an error of some kind? Cheers, Stefan Blixt -- Release me, insect, or I will destroy the Cosmos!
What happens when you execute:
true => lisaLeft.record;
is that you assign “"the value of true to the object property lisaLeft.record, but because of the way the chuck operator is overloaded, this is converted to:
lisaLeft.record(true);
However if you do something like
<<
hey, anyone know what these might mean? [chuck](VM): internal sanity check failed in shredule() [chuck](VM): (wake time is past) - 1979957.700002 : 1980152.000000 funfunfun! dan
Better yet, what method do we call to remove all internal sanity checks?
ChucK, an Insane, Strongly-Timed and On-the-fly Environ/mentality. :)
michael
On Fri, Oct 10, 2014 at 9:36 AM, Dan Trueman
hey, anyone know what these might mean?
[chuck](VM): internal sanity check failed in shredule() [chuck](VM): (wake time is past) - 1979957.700002 : 1980152.000000
funfunfun!
dan _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (4)
-
Dan Trueman
-
Michael Heuer
-
Rich Caloggero
-
Stefan Blixt