Funny would be:
maybe (0.5) {
// Do stuff
} else {
// Do other stuff
}
Tambet
2010/9/4 Rich Caloggero
WOw, what a very cool idea. I vote for it!
-- Rich
----- Original Message ----- *From:* Kassen
*To:* ChucK Users Mailing List *Sent:* Friday, September 03, 2010 3:44 PM *Subject:* [chuck-users] new ideas, new bugs... Fellow ChucKists,
I was poking around in the source for "maybe" to try to figure out how hard Joe's idea would be to implement.
So far it looked really quite easy to me, except that the chuck operator would have to be overloaded to deal with chucking floats to "likely" and "unlikely". This made me wonder what kind of error this would give;
1 => maybe;
It turns out that doesn't give a error at all and instead seg-faults (latest miniAudicle, linux ALSA, canonical version except for the CNoise fix).
So; regardless of whether or not we go with Joe's idea this area does need a look. I vote that we do take this idea as it would be very little work for something that would be that much fun. With a default of .75% for likely and 25% for unlikely it would have all of the advantages of the various proposed strategies and on top of that we'd get a easy "crossfade" for chance-based techniques that may span several shreds.
Yours, Kas.
------------------------------
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users