David Flanagan wrote:
> Since 0 and 1 are both treated as true in Ruby, it would be nice if the
> Random class had a method that would randomly return true or false:
> 
> Random.maybe(probability_of_truth=0.5)

-1 on this.  This is an idea mainly to reduce typing a method (like
n.zero?), and as such a a poor api.
I read that api as only sometimes returning a random number.  Also, it
fails to consider the random number's distribution (not all generators
have to return uniform random numbers).

> 
> A lot of random number generators can return numbers with a gaussian
> distribution.  I've never used this feature, but someone must care about
> it.

I do.  As such, no api method should prevent this.

> I haven't worked with binary I/O in Ruby yet, but would it ever be
> useful to have an infinite stream of random bytes?

-1 on this.  Not sure it would be of any use.   If anything you want a
method to fill a string with random characters, not just bytes (a string
is which may or may not be multibyte).


-- 
Gonzalo Garramu˝´
ggarra / advancedsl.com.ar

AMD4400 - ASUS48N-E
GeForce7300GT
Kubuntu Edgy