[#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: Daniel DeLorme <dan-ml@...42.com>
Date: 2007-06-13 07:12:26 UTC
List: ruby-core #11445
David Flanagan wrote:
> How about accepting a Range object as the argument to methods like 
> integer, float, and rand.  If a single numeric value is passed, then 0 
> is the implicit lower bound.  Otherwise the argument is a range that 
> specifies both the upper and lower bound.

I second this. The idiom "a+rand(b-a)" is just too frequent and deserves 
to be expressed as "rand(a...b)"

Also I think it could be nice to have something like this:
   five = Random.new(saved_seed, 5)
   five.rand #=>number in 0...5
   five.rand #=>another number in 0...5 (reproducible sequence)

Daniel

In This Thread