From: Gavin Sinclair Date: 2003-12-14T09:35:22+09:00 Subject: Re: additional methods for Array On Sunday, December 14, 2003, 10:38:44 AM, Austin wrote: > On Sun, 14 Dec 2003 01:10:55 +0900, David Garamond wrote: >> I'm wondering what other people's thoughts are about adding these >> methods. They are found in PHP but not in Ruby at the moment. I'm not >> submitting an RCR because I don't feel strongly about these myself, but >> since Ruby's class library are usually "battery-included", there might be >> interest to include the methods below as well. Each of these can be >> implemented with a few lines of Ruby. >> >> Array#shuffle -> nil >> Array#pick(n=1) -> anArray (method name?) >> Array#pick(n=1) { |x,y,z...| } (syntax? method name?) feed block with >> Array#chunk(n) -> anArray > I would suggest that you may want to implement these in pure Ruby and add > them to Gavin Sinclair's Standard Library Extensions library available on > RubyForge. If they become popular enough, then people can note that in > feedback and that would weigh heavily on their utility and need. I've highlighted the relevant messages as a reminder for me to add (some of) these. Cheers, Gavin