From: Yugui Date: 2010-01-30T17:10:06+09:00 Subject: [ruby-core:27967] [feature:trunk] RCR: allow {select, collect, map} to accept symbol argument This reply registers the suggestion by Roger to the redmine. and -1 because a method name is not a method itself. Symbol#to_proc is the limit I can accept. On Sat, Jan 30, 2010 at 10:14 AM, Roger Pack wrote: > Background. > > Currently in order to avoid using braces and to use select/map et al, > one must do > > collection.map &:symbol > > This is quite explicit, which is good, however the syntax is somewhat > ugly, which is surprising (mostly because the punctuation is > somewhat...hard to read, at least for this Ruby reader). > > Suggestion: > > Allow map/etc al to accept a single argument, and convert it implicitly to proc. > > collection.map(:symbol) > > This reads more easily. > > Another option would be to add map_by(arg) and collect_by(arg) > > which would actually be more preferable, as least for me. > > Thoughts? > Thanks. > -r > > -- Yuki Sonoda (Yugui)