From: Jeremy Date: 2003-03-24T13:55:28+09:00 Subject: Re: Question about behavior of Array.new Gavin Sinclair wrote: > On Monday, March 24, 2003, 4:12:39 AM, Jeremy wrote: > >> Hi, > >> I recently used the following in a program (game) I'm working on: > >> board = Array.new(9,Space.new) > > A common idiom applied to this case yields: > > board = (0..9).map { Space.new } > > I think this is covered in the newcomers' list. Check it out (in the > documentation bundle at www.ruby-doc.org) for other gotchas. > Thank you for pointing out the documentation bundle at ruby-doc.org. I now have that one sitting happily on my hard drive. On a broader note, I appreciate everybody's response on this subject. These have been good suggestions on working with this "gotcha". Thanks for the help. Jeremy