From: "Matthias Wächter" Date: 2008-02-22T00:28:54+09:00 Subject: Re: What does *args do? Arlen Cuss wrote: >> You can even do multiple assignment this way: >> b, c, d, e = *a >> b # => 1 >> c # => 2 >> d # => 3 >> e # => 4 > It's worth noting that this behaviour can be achieved without the splat > operator: >>> b, c, d, e = a # => [1, 2, 3, 4] >>> b # => 1 >>> c # => 2 >>> d # => 3 >>> e # => 4 I don't like this inconsistency in the language. Left is a list, right should be a list. Making it mate with both list and array can introduce tricky inconsistencies. I am in favor of dropping the latter and always'd require splat for multiple assignment. I think that is _too_ dynamic for an untyped, dynamic language like Ruby. e.g. def not_broken_up a my_a, my_nil1 = a if my_a != a puts "Gotcha!" else p my_a end end not_broken_up 1 # -> 1 not_broken_up "hi" # -> "hi" not_broken_up({1=>1}) # -> {1->1} not_broken_up [1] # -> Gotcha! not_broken_up [1,2] # -> Gotcha! not_broken_up [[1]] # -> Gotcha!