Re:First Impressions of Python from a Java Developer
by generalk on Monday November 08, 2010 @02:51PM
(#1883717)
In Ruby 1.9, or Ruby 1.8 w/ ActiveSupport, you can use the & operator, which coerces it's argument (in this case, a symbol) to a Proc:
This is a common idiom with a fantastic writeup at http://weblog.raganwald.com/2008/02/1100inject.html
[ Parent
| on HN ]
Re:First Impressions of Python from a Java Developer
by DanielRibeiro on Monday November 08, 2010 @03:57PM
(#1883981)
Actually on ruby 1.8.7 the proc coercion is default. No need for active support. And yeah, ruby underscore is overkill for this trivial example.