On 9/28/06, Dr Nic <drnicwilliams / gmail.com> 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. 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?)). The magic dot has a potential to create scads more objects to handle the adapting. With a magic dot, list.map.to_i necessarily has to create some adapter object for the call to map so there's a receiver for to_i where no object was required before. Unless Ruby is adding a pretty powerful GC in the future, perhaps we should avoid adding tons of transient objects just for the magic dot. The magic underscore has far less potential to cause a collision and requires no intermediate objects to be created. And as others have mentioned, it's been proven to look and feel really nice by ActiveRecord. -- Contribute to RubySpec! @ www.headius.com/rubyspec Charles Oliver Nutter @ headius.blogspot.com Ruby User @ ruby.mn