<a href="http://wiki.cs.princeton.edu/index.php/ChucK/Features/Release">http://wiki.cs.princeton.edu/index.php/ChucK/Features/Release</a> - the most prioritized feat for next release is extending maybe.<br><br>As I just thought of it today and my thoughts are better than there - I think that a simple overload for multiplication operator would be just enough.<br>

<br>Like this:<br><br>if (maybe * 0.2) {<br>  // Runs with probability of 20%<br>}<br><br>Or, more coherent, but less nice:<br><br>if (maybe(0.2)) {<br>
  // Runs with probability of 20%<br>
}<br>
<br>Then, when doing switches, how to handle those? It would be nice to have something like:<br><br>switch {<br>  case maybe * 0.3:<br>  case maybe * 0.5:<br>  case maybe * 0.6:<br>  case true:<br>}<br><br>In case it would automatically fix all maybes - so that actual probabilities would add up to 100% and, thus, first one is fixed to about 0.2 and second one to slightly less than 0.5 ..this would allow really nice play with probabilities (and, of course, optimizations internally).<br>

<br clear="all">Tambet<br>