News for hackers. Stuff that matters.
Re:(1..100).inject(&:+) by raganwald on Monday February 25, 2008 @04:55PM (#123384)
"After learning more languages, Ruby is starting to become pretty ugly to me, but somehow people keep managing to ignore all its faults, make little hacks like these, and be very productive with it."

When I first saw it, I wondered why anyone would want this irregular little language when they could just use Smalltalk or Scheme. An early rant asked why I have to know the difference between a block and a Proc: why the &^(%*)(& do I have to know when to use a block, when to use a Proc, and how to convert between them???

Re:(1..100).inject(&:+) by mdemare on Monday February 25, 2008 @07:53PM (#123491)
For those who think the above is pretty tame and have been using it for years, we've got a series on our blog where we introduce and discuss a new method every day.

http://blog.rubyenrails.nl/articles/category/daily_method

Here we create a to_proc method for Hash: http://blog.rubyenrails.nl/articles/2008/02/26/a-hash-is-a-f...

Re:(1..100).inject(&:+) by raganwald on Monday February 25, 2008 @08:37PM (#123533)
I subscribe to the series and enjoy it. I hadn't seen Hash#to_proc, I look forward to considering the possibilities carefully...