From: Yukihiro Matsumoto Date: 2007-02-17T23:20:48+09:00 Subject: Re: Oppinions on RCR for dup on immutable classes Hi, In message "Re: Oppinions on RCR for dup on immutable classes" on Sat, 17 Feb 2007 22:51:06 +0900, Stefan Rusterholz writes: |With current implementation, the only way to figure if an object can be |dup'ed is by dup it and catch the exception. I don't know how imperative |duck-typing is for ruby, but this way actively prohibits it. As far as I understand, DuckTyping is not something based on method existence, but something letting them raise error without explicit type checking. |As said before, the issue can be worked around (as you say e.g. via |exception handling), but following your argument, my question would be: |why implement a method that can't be executed? We haven't implemented a method that can't be executed. Object#dup just fails if the object is not able to be duped. Am I missing something? matz.