From: Jacob Fugal Date: 2006-10-25T00:11:37+09:00 Subject: Re: '**' as hash splat? On 10/24/06, dblack@wobblini.net wrote: > On Tue, 24 Oct 2006, 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' > > irb(main):003:0> a = [2,1] > => [2, 1] > irb(main):004:0> [3, *a] > => [3, 2, 1] I think Kalman was just pointing out that [] (in this case as the array literal syntax) is *not* a method, contrary to what Ken had claimed. Jacob Fugal