From: Robert Dober Date: 2006-10-26T01:53:46+09:00 Subject: Re: '**' as hash splat? ------=_Part_33460_32258902.1161795222107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/24/06, Kalman Noel wrote: > > Ken Bloom: > > On Mon, 23 Oct 2006 20:49:55 -0700, Trans wrote: > >> a = [2,1] > >> [3,*a] #=> [3,2,1] > > The purpose of splat is to convert an array into a list of parameters to > a > > method. Since [] is a method, > > irb> method :[] > NameError: undefined method `[]' for class `Object' > > Kalman Maybe you want to try this Array.instance_method :[] Cheers Robert -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw ------=_Part_33460_32258902.1161795222107--