From: Yukihiro Matsumoto Date: 2007-02-19T16:56:53+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 Sun, 18 Feb 2007 02:54:42 +0900, Stefan Rusterholz writes: |> If we see a class as a restaurant, your illustration makes sense. But |> from my point of view, we don't know the name of the restaurant, nor |> its menu. We just sit and cry for "Spaghetti!", and sometimes the |> waiter says "I'm sorry". |The example translates to: |Restaurant := Class |Menucard := #methods |Say "we don't serve that" := raised Exception I don't deny your model, but it smells like static typing. In Ruby, we do obj.dup not, void foo(SomeClass obj) { obj.dup(); } We don't see any class in Ruby example, we just see an object, and order it to dup, assuming it can dup itself, without knowing whether it is really able to dup. If it can't, for some reason, it raises an exception. The best illustration for the situation (in Ruby, not being Java) is something like above "sit and order" model. matz.