From: Kevin Smith Date: 2001-09-04T00:24:34+09:00 Subject: [ruby-talk:20783] Re: RCR: non-bang equivalent to []= --- ts wrote: > >>>>> "T" == Tobias Reif > writes: > > T> Or did I get you wrong. > > Well, you are missing RCO. An example : > > pigeon% ruby -e 'a = [1]; a << a; b = a.clone, a[1] = > "a"; p b' > [[1, [1, "a"]], "a"] I guess I understand this, and I'm willing to live with it because I personally don't ever want to nest arrays inside each other. Too weird for me. So I would be happy if we could come up with an array method that makes a between-shallow-and-deep copy. We don't have to name it clone, since that has many meanings. How about: class Array def copy return []+self end end Kevin __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com