[#11439] comments needed for Random class — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2007/06/12

[#11450] Re: new method dispatch rule (matz' proposal) — David Flanagan <david@...>

This is a late response to the very long thread that started back in

17 messages 2007/06/13

[#11482] Ruby Changes Its Mind About Non-Word Characters — James Edward Gray II <james@...>

Does this look like a bug to anyone else?

10 messages 2007/06/16

[#11505] Question about the patchlevel release cycle — Sylvain Joyeux <sylvain.joyeux@...4x.org>

1.8.6 thread support was broken in bad ways. It stayed for three months

20 messages 2007/06/20
[#11512] Re: Question about the patchlevel release cycle — Urabe Shyouhei <shyouhei@...> 2007/06/20

Hi, I'm the 1.8.6 branch manager.

[#11543] Re: Apple reportedly to ship with ruby 1.8.6-p36 unless informed what to patch — James Edward Gray II <james@...>

On Jun 27, 2007, at 4:47 PM, Bill Kelly wrote:

10 messages 2007/06/27

Re: comments needed for Random class

From: gga <ggarra@...>
Date: 2007-06-13 00:48:32 UTC
List: ruby-core #11444
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

In This Thread