Hi,

I recently used the following in a program (game) I'm working on:

board = Array.new(9,Space.new)

I found out at this point, and with a bit of searching in the ruby.lang
archives, that this winds up creating an array with nine references to the
same object.  So, now knowing that this happens, I can deal with it, but
what I want to know is WHY it's like this.  Perhaps it's just the way my
mind works, but to me, this kind of goes against the "least surprise" ethic
of ruby.  I, personally, would expect that this would create nine new
objects, not references to the same object.

Can anyone enlighten me on this?

Thanks,
Jeremy