From: Marnen Laibow-Koser Date: 2009-11-10T00:49:07+09:00 Subject: Re: RCR enumerable extra into core Roger Pack wrote: > >>> which is arguably less readable. >>> Thoughts? >> >> At the same time, the merit of &:name over :name is that &:name does >> tell you what's going on, once you know that the & in front of any >> object (symbol or otherwise) in last-argument position means that the >> object will be converted to a Proc and play the block role. > > Hmm. I suppose I'm of a slightly different opinion--to me > list.map &:symbol > > is less clear than > list.map(:symbol) > > > If we were required to write > list.map &:symbol.to_proc But we are. &:symbol is equivalent to :symbol.to_proc. So the & form is explicit -- and thus arguably clearer. I would almost expect list.map :symbol to return :symbol for each item in list. > > then I would be more easily convinced that list.map(:symbol) is too > implicit. So for me it's implicit already. Because you're misunderstanding the syntax. > > I'm not too worried about the run time slowdown...so many methods are > already special cased...it doesn't seem to be a too large concern to the > core guys... > > -r Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.