From: Stefan Rusterholz Date: 2008-10-30T21:22:59+09:00 Subject: Re: Bug or not a bug? array*=int Kyle Schmitt wrote: > Ahh. > And upon not being lazy and looking at the C, I see this... > ary2 = ary_new(rb_obj_class(ary), len); > > Which I'm guessing is equivalent to this in ruby (which I already knew > would return the same array len times) > ary2=Array.new(ary,len) > > Any chance the document maintainer could slip the word "shallow" into > the description of array*? > > :) As mentioned by others, shallow is the default (also to my knowledge in most OO languages). The moment you wish for deep copy is usually the moment you should consider writing a proper class instead of deeply nesting arrays/hashes/... Regards Stefan -- Posted via http://www.ruby-forum.com/.