From: Tanaka Akira Date: 2003-07-09T12:34:31+09:00 Subject: Re: Marshaling objects partially In article <1057720032.125208.13426.nullmailer@picachu.netlab.jp>, matz@ruby-lang.org (Yukihiro Matsumoto) writes: > By this change, _dump() and _load() can return/receive arbitrary > object, not only string. When object A and B refer each other, which _load is called first? class C def _dump ... end def C._load(obj) ... end end A = C.new B = C.new A.instance_eval { @ref = B; @xxx = STDIN } B.instance_eval { @ref = A; @xxx = STDIN } m = Marshal.dump(A) Marshal.load(m) If _load for A is called first, it cannot initialize @ref to copy of B because it is not exist yet. If _load for B is called first, it cannot initialize @ref to copy of A because it is not exist yet. So, I think _load should be an instance method. (See [ruby-dev:18312] for details.) -- Tanaka Akira