From: Sebastian Hungerecker Date: 2007-12-25T21:52:02+09:00 Subject: Re: Problem with copying array Bryan Duxbury wrote: > What's your array an array of? Array.dup will copy the array to a new > array, but if the values in the array are references to some class > you're using, it'll be a different array of the same items. > Primitives would be copied correctly. You need to do your own deep > copy if it's a more complicated array value. a) There are no primitives in ruby. Everything is an object. b) Array#dup never makes a deep copy. You'll always get a different array of the same items no matter what the class of these items is. HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826