Hi,

In message "Re: [ruby-core:18164] Re: New array methods cycle, choice, shuffle (plus bug in cycle)"
    on Thu, 7 Aug 2008 18:35:28 +0900, gdefty / attglobal.net writes:

|I have the same expectation of the order being
|preserved. It is not because I have any particular
|reason to preserve it, but simply because that is
|how I would expect a reasonable implementation to
|work.

I am against #sample! for the name.  If one try to persuade me to add
a method with the behavior, the name should be anything but #sample!

|The problem with the shuffle-and-shift solutions
|is that they do not scale well with the size of
|the array. It is fine for small amounts of data
|(e.g. the rock-paper-scissors example) but not how
|I would expect a built-in method to be coded,
|where the size of the array can not be known in
|advance.

I believe the calculation complexity of shuffle-once-and-pop is far
lesser than pick-some-elements-and-remove-them, even with an array of
thousands of elements.

							matz.