From: "Jesús Gabriel y Galán" Date: 2009-03-06T03:00:52+09:00 Subject: Re: Any solutions to Ruby's inconsistencies? On Thu, Mar 5, 2009 at 4:41 PM, Yossef Mendelssohn wrote: > On Mar 4, 3:32 pm, "C. Dagnon" wrote: >> >     key = map.keys.detect { |k|  k.to_s.downcase == >> > matcher.to_s.downcase } >> >> Hmmm, what is 'detect'? > > 'detect' is a synonym for 'find' (or maybe it's the other way around). > > I prefer to use the *ect methods when working with Enumerables instead > of the simpler/shorter synonyms. This is in part because they get some > consistency and connection, but also because Rails overrides some of > them on Enumerable-like association proxies. And some of them don't > even have non-ect synonyms. > >  [].detect  -> [].find >  [].select  -> [].find_all >  [].reject  -> >  [].collect -> [].map >  [].inject  -> Interesting. Now that I think about which versions I use, I don't have a rule :-). I use: find select reject map inject So, no consistency or anything. Just the ones that I like better, I suppose :-D. Jesus.