From: Julian Leviston Date: 2008-04-02T15:50:43+09:00 Subject: Re: inject's pathological case... Yeah, even map/collect is annoying enough. Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO OUT 3rd APRIL http://sensei.zenunit.com/ On 02/04/2008, at 5:41 PM, David A. Black wrote: > Hi -- > > On Mon, 31 Mar 2008, Yukihiro Matsumoto wrote: > >> Hi, >> >> In message "Re: inject's pathological case..." >> on Mon, 31 Mar 2008 00:27:58 +0900, "David A. Black" > > writes: >> >> |> AFAIK, Matz correct me if I'm wrong, Ruby got the name inject from >> |> Smalltalk, along with collect, select, detect and several other >> |> methods. The other three I mention have alias, map for collect, >> |> find_all for select, and find for detect, but inject is still just >> |> inject in Ruby. >> | >> |It picks up the synonym "reduce" in 1.9 -- which I think is kind of >> |too bad, since inject in Ruby has such a distinctive personality and >> |cult following :-) >> >> reduce, fold, foldl; these are some of the candidates. But I think I >> have to wait for consensus for a while. > > I would like to suggest the null alias :-) I think calling it #inject > is fine. It's well-documented that the same function has other names > in other languages; I don't think Ruby needs more than one, and it > just adds the need to explain and account for the synonym. > > > David