http://wiki.cs.princeton.edu/index.php/ChucK/Features/Release - the most prioritized feat for next release is extending maybe.

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.

Like this:

if (maybe * 0.2) {
  // Runs with probability of 20%
}

Or, more coherent, but less nice:

if (maybe(0.2)) {
  // Runs with probability of 20%
}

Then, when doing switches, how to handle those? It would be nice to have something like:

switch {
  case maybe * 0.3:
  case maybe * 0.5:
  case maybe * 0.6:
  case true:
}

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

Tambet