From: Martin DeMello Date: 2008-08-24T05:33:37+09:00 Subject: Re: remove_const, Kernel.load, and already instantiated objects On Sat, Aug 23, 2008 at 9:05 AM, Brent Dillingham wrote: > > I did try to go the Marshal route, but Marshal.dump chokes when trying to > dump most of my objects with "TypeError: can't dump hash with default proc". > I don't know exactly what that's referring to (the stack trace is useless), > but it probably has something to do with a DataMapper feature. Marshal seems > to be pretty unreliable for any kind of non-trivial object, and I think > doing any kind of "deep copy" on my objects will lead to weird duplication Hm - if you're persisting to a database, what I'd recommend is implementing a load and save feature, then doing a save/reload class/load cycle when code changes. It will require a bit of up front work to distinguish between game state and incidental state, but that should improve your design too, and simplify the rest of your code moving forward. martin