Patrick Bennett wrote: > Tom Gilbert wrote: > >> Can't you deep copy using Marshal? >> >> a = Marshal.restore(Marshal.dump(b)) >> > I guess(?) It seems like a pretty major hack though. It really should > be built into the language, or into the standard > library distribution. I agree it seems hackish to generate strings just to deep-copy objects, but there is an advantage to using Marshal: it guarantees that this deep copy operation has *exactly* the same semantics as sending objects to disk or to other processes. What if some class defined its own _dump and _load (maybe because the objects have a reference to some large shared data structure), but forgot to do whatever it has to do so that deep copy follows the same principle?