From: Warren Brown Date: 2004-04-24T00:43:23+09:00 Subject: Re: Problem assigning an Array object to an Array-subclass object Richard, > myA1 = MyArrayType.new > myA1 = %w[x1, y1] Your problem is that you assign myA1 the object (MyArrayType.new), then you assign myA1 the object (%w[x1, y1]). This is similar to saying: x = 2 x = 5 Also note that (%w[x1, y1]) is equivalent to (["x1,", "y1"]), which is why you thought you were getting a comma separator. > 1. How can I set myA1 to an array value > and preserve it's type? You would need to either use one of the self-modifying functions of array (e.g. Array#replace), or add similar functionality to your MyArrayType class. > 2. Isn't there a "Ruby way" to set the separator Well, Array#to_s simply calls Array#join, and Array#join accepts a string separator that defaults to the variable $, (dollar comma). So you can either set $, to whatever you want, or you can simply call Array#join yourself. I hope this helps. - Warren Brown