Since I don't use ruby either...I tried a web based interpreter.
>> (1..100).inject(&:+)
TypeError: wrong argument type Symbol (expected Proc)
from (irb):1
I also am not a fan of doing things a thousand different obscure ways. I like doing things one way, and having that way highly optimized. Typing 10 characters or 20 characters doesn't impact my programming speed, I spend far more time thinking about how to do things the right way.
edit:
Ok, did his monkeypatch and it worked. You get 5050. So it is equiv to sum(range(101)) in python, and much less readable. I fail to see why this is a good thing.
Why what is a good thing? Why that line of code is a good thing? maybe it isn't, maybe arrays need a sum method, maybe you could just write:
(1..100).inject { |acc, n| acc + n }
...and get the same result. But the article has nothing to do with why that line of code is a good thing, it is about the fact that being able to modify the Symbol class in this manner is what makes a langauge like Ruby evolve from the bottom up.
So... do you think that is a good thing? Or a bad thing?
I think that style of code is rather hard to read and really doesn't add any functionality that couldn't be done in a much more readable way in the same number of characters.
So I am wondering why the author thinks its so fantastic.
As for developing the language, I am usually for flexibility and allowing anything to be modified, however this type of change strikes me as not very useful.
"I am usually for flexibility and allowing anything to be modified, however this type of change strikes me as not very useful."
That's entirely the point. If you are in favour of flexibility, you have to accept that people will use it for all sorts of things, not just ones you like.
I was talking about the fact that they are making that change on the core language. Providing the flexibility is different from putting it in the language.
Anyways, I don't really care, saying anything other than 'I love ruby' is shunned anyways.
Yeah I didn't mean to blame you... I actually like it, so consider it a complement, but it was just the easiest way to describe what patch I was talking about, since you had it in your article.