3 ms·
Personally, I prefer your version; the &: version starts reeking of Perl line noise. Although I believe Ruby would benefit from an _ for not explicitly named bl
by Confusion 16y ago
Personally, I prefer your version; the &: version starts reeking of Perl line noise. Although I believe Ruby would benefit from an _ for not explicitly named block arguments.
- mark_l_watson 16y agoI agree, I also prefer the slightly longer version. OK, enough small talk ... :-)
- steveklabnik 16y agoAs a random note for anyone who's wondering how this syntax came about, this is the Symbol#to_proc [1] method, which was actually a monkeypatch from Rails that ended up making its way back into Ruby proper. 1: http://ruby-doc.org/core-1.9/classes/Symbol.html#M000031 http://ruby-doc.org/core-1.9/classes/Symbol.html#M000031