Patches item #6442, was opened at 2006-11-01 16:08
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=6442&group_id=426

Category: Ruby1.8
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Alexey Radul (axch)
Assigned to: Nobody (None)
Summary: Array#shuffle and Array#shuffle!

Initial Comment:
First off, kudos for developing an awesome language!

As a matter of language design, should Array always have a shuffle method, or should that method only appear if one writes require 'array'?  If the former, how can that be accomplished?

Patch effect:
Added a lib/array.rb for pure-ruby extensions to the core Array class, and defined shuffle and shuffle! methods for Array in it.  Put the unit tests for those methods into the same file, with an if $0 == __FILE__ guard.  (Also edited lib/README to include lib/array.rb).


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=6442&group_id=426