From: itsme213 Date: 2004-12-14T13:47:18+09:00 Subject: Re: How to make a deep copy of an object (Searching for Idiom) "Chuckl" wrote in message > I've also been thinking about deep_copy, but for a different reason. I > want to keep a mutation log for each object instance. So if this > occurs: > > foo = Obj.new(:blah) > foo.warp_blah! > foo.twist_blah = :different_blah > > Then somewhere, preferably abstracted inside each object instance, I'd > have a log like: > > puts foo.mutation_log => ["wrap_blah!", ["twist_blah=", > :different_blah]] > > When the method Obj.checkpoint is called, the log is cleared and the > current state returned as a Marshall-ing, or some other store-savable > format. Madeline does something quite similar http://madeleine.sourceforge.net/ ... may be worth a look.