From: Phrogz Date: 2007-02-17T04:50:07+09:00 Subject: Re: Oppinions on RCR for dup on immutable classes On Feb 16, 12:30 pm, dbl...@wobblini.net wrote: > You could conceivably have a case where an object can't be dup'd, but > is mutable, like a singleton class. If dup returns self, then you > could end up changing the object when you didn't want to. It's > probably not an everyday problem... but I still don't like the idea of > having to remember that "dup" means "dup or self". Yes, but that would only be a problem if you did: class Object alias old_dup dup def dup self.old_dup rescue self end end I would certainly not like that, either. The OPs proposal, however, was to modify the behavior only for a particular set of built-in immutable objects: [NilClass, FalseClass, TrueClass, Fixnum, Symbol] (Though, if you 'fix' Fixnum like this, you'll need to 'fix' Bignum and Float and others as well to support duping.)