From: synergism Date: 2009-02-19T20:25:09+09:00 Subject: Re: Marshal.dump fails on extended OpenStruct On Feb 17, 4:32 pm, Justin Collins wrote: > You could just write new marshal_dump and marshal_load methods: Thanks. I considered that, but the bigger issue is that this makes using DRb in any application of non-trivial complexity quite painful, as we now need to mess with the implementation details of every serialized object. I was just hoping something more transparent could be done with ostruct to make things better. Incidentally, I continued with the delegation model I used in my example and found that this wasn't where the trouble ended. I had to also eliminate an un-dumpable proc I had used to auto-initialize a Hash of Hashes (to make an empty hash be the default value so that [] [] references would not raise an exception on uninitialized keys) i.e. class AutoHash < Hash def [] key _=fetch(key) rescue _=store(key,{}) _ end end class C def initialize # ... @attributes=AutoHash.new end end instead of: # ... @attributes=Hash.new{|hash,key| hash[key]={}} It seems programming with DRb is fraught with difficulties like these. I wish we had something easier to use, as otherwise DRb is exactly what we need for this application. Ben