+1 to David.  A convenient way to do Marshal idiom should be a new
method rather than an extension to existing dup semantics.

David A. Black wrote:
> Hi --
>
> On Mon, 21 Jul 2008, Nasir Khan wrote:
>
>> I write a lot of hand crafted dup or clone because I want control as
>> well as
>> better performance than the Marshal idiom. I ended up re-opening
>> NilClass,
>> TrueClass and FalseClass for def dup; self; end
>> While most of the things in Ruby are very intuitive and predictable from
>> functional perspective, this sort of stood out.. that's all.
>
> I understand not wanting true.dup etc. to break things, but it's hard
> for me to get past the fact that true.dup doesn't return a dup of
> true, if it's defined to return true. Maybe it's a case for a
> "dangerous" dup:
>
>   class Object
>     def dup!
>       dup
>     rescue TypeError
>       self
>     end
>   end
>
>
> David
>