Re:Rust is surprisingly expressive
by matthewmacleod on Saturday December 28, 2013 @05:22PM
(#6976919)
Yet this is what Ruby does, AFAIK.
Numeric#days is an ActiveSupport method, not core Ruby. But yes, it does patch the behaviour into a core class.
This is a bit of a legacy of Ruby programming, and it's definitely bad to pollute the global namespace. However, I expect we'll see eventual use of Refinements (http://www.rubyinside.com/ruby-refinements-an-overview-of-a-...) now that they are available; this will allow classes to override core methods without affecting other classes out of scope.
Yet this is what Ruby does, AFAIK.