From: dblack@... Date: 2006-09-30T00:00:32+09:00 Subject: Re: New magical version of Symbol.to_proc Hi -- On Fri, 29 Sep 2006, Charles O Nutter wrote: > On 9/28/06, Dr Nic wrote: >> I like this idea too - something that allows you to pick which iterator >> method to use (that is: select, each, map) >> >> Implementable syntax might be: >> >> %w{the meaning of 42}.map_length > > FWIW I really prefer the magic underscore over anything else. I do too, generally, though map_length sounds like "the length of the map of this object". One starts to think there's a reason that map takes a block.... > The pluralization thing has too much potential for collision and looks > jarring (to_as looks to me like "to" "as", which doesn't make any > sense; then again I'm not a fan of programmatic pluralization for any > reason, since it's very western-language-centric and far from > foolproof (moose? virus? fish?)). Yeah, that was my point with sheep, even though I do rather like the way the plural things read (when they work). How about: array.meese.each do |moose| ... end The mind boggles :-) David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org