From: Dan Zwell Date: 2007-08-02T11:46:53+09:00 Subject: Re: change method Array.new? (Was: Unexpected behavior with Armin Armbruster wrote: > I have no problem with Array.new(size, obj), in fact I think it is a > syntactically nice form. What I have a problem with is that it behaves > differently, depending what the object is. > You'll find the same behavior in every type of function, and you'll get used to it. Numbers, booleans, and at least one other class that I don't remember at the moment are passed this way. I'm not sure about subclasses of the aforementioned, but I think they are still passed by value (i.e., all Numeric classes are so passed). If you need to pass a different class by value, just pass my_variable.dup instead. Dan