On Nov 29, 2010, at 14:58 , John W Higgins wrote:

> x = Array.new 5, 'A'
> h = { a: x, b: 0, c: 1 }

or better:

h = { a: ["A"] * 5, b: 0, c: 1 }

I never understand ppl's obsession with Array.new and Hash.new, not including hash's block initializer. Hash.new {...} is brilliant and I love it. I think all variants or Array.new are essentially useless and stick to [] for everything.

Most of my students who Array.new that were Java developers and it was pretty easy to break them of the habit.