It would seem that this is a new feature 1.9:
$ rvm use 1.8.7 $ irb ruby-1.8.7-p352 :001 > x = [ 1,2,3,:a => 4, :b => 5 ] SyntaxError: compile error (irb):1: syntax error, unexpected tASSOC, expecting ']' x = [ 1,2,3,:a => 4, :b => 5 ] ^ from (irb):1 ruby-1.8.7-p352 :002 > exit $ rvm use 1.9.3 $ irb ruby-1.9.3-p0 :001 > x = [ 1,2,3,:a => 4, :b => 5 ] => [1, 2, 3, {:a=>4, :b=>5}] ruby-1.9.3-p0 :002 >
davetron5000
source share