From: Pit Capitain Date: 2007-02-16T04:47:32+09:00 Subject: Re: Creating a second instance of a singleton class? hemant schrieb: > On 2/15/07, Pit Capitain wrote: >> It says: While +clone+ is used to duplicate an object, including its >> internal state, +dup+ typically uses the class of the descendent object >> to create the new instance. > > Hey Pit, Internal State was not quite so clear to me so i read up in > ri and passed right over it, thanks for clearing it up. > Also, then may be we should be able to, marshal the damn singletons > also. But PickAxe says Singletons are literally invisible. Hemant, to be fair, I hadn't thought of singleton classes, too, before actually trying it. In retrospect, it makes kind of sense, that the internal state of an object includes the singleton class' methods. And if its the business of the object's class to do the #dup, then it is clear that this can't include singleton methods, because the class doesn't know about them. Being able to marshal classes and singleton classes would be very nice, but its not officially supported yet. There are workarounds to do this, though. Regards, Pit