Ruby 1.9 Fun

Dave Thomas (of Pragmatic Programmers fame) describes some new Ruby 1.9 syntax:

first, *, last = 1,2,3,4,5
puts first
puts last

will produce

1
5

The same syntax also works for method definitions

def test( first, *, last)
  puts first
  puts last
end
test( 1, 2, 3, 4, 5 )

will produce the same output as above.