From: Chris Carter Date: 2007-03-20T11:32:22+09:00 Subject: Re: [ ruby-Bugs-9376 ] Marshal.dump shouldn't complain about singletons if the _dump method is defined On 3/19/07, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [ ruby-Bugs-9376 ] Marshal.dump shouldn't complain about singletons if the _dump method is defined" > on Tue, 20 Mar 2007 04:16:41 +0900, Sylvain Joyeux writes: > > |> > Is that really the intended behaviour ? > |> Yes. > |Well ... maybe you can explain a bit more the "why" ... > > Because objects with singleton data can not be shared across > processes. Objects in marshaled data can live longer than processes. > In this case, how can we tell the object t work properly without @bla > variable set? > > matz. > > But what if that singleton class just contained a method that allowed direct access to a variable, or a quick hack to mutate something, should those methods make it so it cannot be dumped. Can't the interpreter just assume we know what we are doing? -- Chris Carter concentrationstudios.com brynmawrcs.com