From: katz bo Date: 2009-12-21T01:50:10+09:00 Subject: [ruby-core:27250] [Bug #2422] splat operator fails on array of 1 element Issue #2422 has been updated by katz bo. I personally think *[1, 2, 3] should be always unpacked first. a = *[1, 2, 3] #(unpack Array due to *) should be equal to: a = 1, 2, 3 #(as Ruby is very smart) is equal to: (this is really the tricky part) *a = 1, 2, 3 #which packs 1, 2, 3 into Array a. Hence is equal to a = [1, 2, 3] a = *[1] #(unpack Array due to *) should be equal to: a = 1 #(again, Ruby is smart it won't read this as *a = 1) a, b = *[1, 2] #the Array gets unpacked first, so we get: a, b = 1, 2 #this behaves identical to the next line: a, b = [1, 2] #Hence a = 1; b = 2 If my understanding is correct, then the 1.9 behavior is a bug(TM). I'm a noob so don't expect me to know what I'm talking about :D. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2422 ---------------------------------------- http://redmine.ruby-lang.org