Hi -- On Wed, 25 Oct 2006, Jacob Fugal wrote: > On 10/24/06, dblack / wobblini.net <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. Right, I didn't pick up on that. David -- David A. Black | dblack / wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org