From: Florian Gross Date: 2004-05-18T03:13:54+09:00 Subject: Re: Why do #dup and #clone behave differently with respect to instance methods Robert Klemme wrote: > "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." > http://www.ruby-doc.org/docs/rdoc/1.9/classes/Object.html#M000889 > I'm interested in the reasoning behind this. I think the rationale is singleton methods being part of internal state. I'm actually depending on this behavior for stripping singleton methods from potentially dangerous objects so if this is to be changed I would need an alternative way to clone objects without their singleton methods. > Kind regards > robert More regards, Florian Gross