Hi,

The word that sprang to mind for me when trying to think of a way to 
incorporate the flavour of randomness was 'sample', which (in the 
statistical sense of 'random sample' anyway) seems to give the right 
flavour.

In addition, it could be possible to add an optional parameter to say how 
many elements are wanted. I realise that this may be straying a little from 
the original intent, but being able to say, for example

     array.sample(5)

makes sense to me, and if combined with a ! variant, as Charles 
suggested, I can much more easily see a use for it.

The nice thing about it, though, is that you can read it as a verb OR a 
noun, as you prefer!

Regards,

graeme


---- Original Message ----

From: Yukihiro Matsumoto <matz / ruby-lang.org>
To: ruby-core / ruby-lang.org
Cc: 
Subject: [ruby-core:18037] Re: New array methods cycle, choice, shuffle 
(plus bug in cycle)
Date: Fri, August 01, 2008, 08:50:00

Hi,

In message "Re: [ruby-core:18036] Re: New array methods cycle, choice, 
shuffle (plus bug in cycle)"
    on Fri, 1 Aug 2008 08:33:15 +0900, Charles Oliver Nutter 
<charles.nutter / sun.com> writes:

|choice is a noun. choose, map, select, collect, etc are imperative 
|verbs. So choose much more consistent with the others. Also, choice 
|implies to me that it's already been made...since you can't have a 
|choice unless you've already made a "choice". In essence, a "choice" is 
|the product of "choosing" something. So ary.choose produces a choice.

Interestingly Python chose "choice" for the method.  Does anyone have
any additional info? 

						
	matz.