From: Raul Parolari Date: 2009-12-01T14:53:56+09:00 Subject: Re: Splat array with 1 value in Ruby 1.9 vs Ruby 1.8 [ Sorry for the horrible indentation. I repeat the text renouncing to align the expressions ] In porting some automation code from 1.8.7 to 1.9.1, I find that in ruby 1.8 the following worked (real code is unpacking binary strings and assigning variables, but I simplify for clarity): var1 = *[ val1 ] # => var1 = val1 var1, var2, varn = *[ val1, val2, valn ] (I know that the splat is not necessary in the second case, but this allowed the code to be generated in the same way, regardless of array size). With Ruby 1.9.1, instead, this happens: var1 = *[ val1 ] # => var1 = [ val1 ] (!) var1, var2, varn = *[ val1, val2, valn ] Of course, this can be handled by generating code that checks the array size. But I am curious on this behavior of splat when the array contains one element (I read about the features of splat in 1.9, but they seem to have nothing to do with this). Does anyone know if it is a bug or intentional? Thanks -- Posted via http://www.ruby-forum.com/.