From: Yukihiro Matsumoto Date: 2008-12-05T07:40:24+09:00 Subject: [ruby-core:20328] Re: Leave my open classes alone (was Behavior: autoload calls rb_require() directly) Hi, In message "Re: [ruby-core:20323] Leave my open classes alone (was Behavior: autoload calls rb_require() directly)" on Fri, 5 Dec 2008 06:25:08 +0900, Dave Thomas writes: |Every time we do something like this, we add more special cases to the |language. Right now, classes are open. We allow people to modify their |behavior. That's just Ruby. Take away plus, and you limit my freedom. |What's next? Maybe Fixnum.to_s. And then maybe Struct.to_s. And then |maybe all internal classes get closed, and no one would be able to |create things such as Symbol.to_proc. Don't get me wrong. No matter how Charles agreed, I said I wanted to separate the namespace, and protect core from "casual" user modification, but did not intended to freeze anything. Actually quite opposite. Another example is mathn library, which replaces core math operation in a somewhat useful manner, but introduces serious incompatibility at the same time. If we can separate effect of mathn in a region or namespace, we can live happier with controlled monkey patching. |I'd much rather see change going the other way. I'd like to see a = |"cat" calling String.new. I'd like to see fewer special cases. Interesting. if a = "cat" calls String.new, it should take an (string) argument to initialize the content "cat", then how should the original content sting be initialized? matz.