From: Yossef Mendelssohn Date: 2012-07-09T03:20:35+09:00 Subject: Re: Array#rand vs Array#sample --e89a8f5039c86c2af404c4558b1c Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jul 8, 2012 at 12:15 PM, Shai Rosenfeld wrote: > I know there are ways around to define an alias for #rand on Array, but > am just curious; Why isn't it named #rand in ruby core? And if there's > no reason, why not add it? If you're defining a new Array instance method using random numbers and Array#rand exists, you'd have to be sure to use `Kernel::rand` instead of just `rand`. -- -yossef --e89a8f5039c86c2af404c4558b1c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Jul 8, 2012 at 12:15 PM, Shai Rosenfeld <lists@ruby-forum.com> wrote:
I know there are ways around to define an alias for #rand on Array, but
am just curious; Why isn't it named #rand in ruby core? And if there= 9;s
no reason, why not add it?

If you're de= fining a new Array instance method using random numbers and Array#rand exis= ts, you'd have to be sure to use `Kernel::rand` instead of just `rand`.= =A0

--
-yossef
--e89a8f5039c86c2af404c4558b1c--