On Tuesday, July 22, 2003, 3:03:51 AM, Jason wrote: >> > >> > I find that when I need to do a deep copy that I >> > usually just do the following: >> > >> > x = Marshal.load(Marshal.dump(y) >> > >> > >> > Is there a more concise (possibly faster) method that >> > combines these two steps? If not, should we add one? > [...] > class Object > def deep_clone > Marshal::load(Marshal.dump(self)) > end > end Just keep in mind that not everything can be marshalled. If #deep_clone appeared in the language implemented like this, people might get surprised when their Binding, IO, Proc, and singleton objects aren't cloned. Just maybe... Gavin