Array#rand vs Array#sample

I was asking some people "Do you know if a #rand method exists on an
array object"? Unanimously, I got a "yup" response back. Actually it's
called #sample.

http://www.ruby-doc.org/core-1.9.2/Array.html#method-i-sample

Seems like rand doesn't exist on Array.

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?

···

--
Posted via http://www.ruby-forum.com/.

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

···

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's
no reason, why not add it?

--
-yossef