Joel VanderWerf wrote:
> Keith Barr wrote:
>>     str = "0123456789 0123456789 0123456789 0123456789 0123456789
>> 0123456789 0123456789 0123456789 0123456789 0123456789 "
>>     @huge_mem = Array.new(1000000, str)
> 
> That's an array of 1000000 references to the same string. Did you want
> lots of strings? This is the way to do that:
> 
> Array.new(1000000) {str}
> 
> ------------------------------------------------------------- Array::new
>       Array.new(size=0, obj=nil)
>       Array.new(array)
>       Array.new(size) {|index| block }

oops, yeah, good catch.
-- 
Posted via http://www.ruby-forum.com/.