On Sun, Mar 30, 2008 at 10:30 AM, Marc Heiler <shevegen@linuxmail.org> wrote:
> > Understand that it's a way to reduce/fold the elements
> > of an enumerable into a single value.
>
> Not that this is important, but personally I never liked the name
> .inject
> Though fold(l/r) is not much better either.
>
> A peculiar thing is that the wikipedia page gives "also known variously
> as " four different names as alternative/example.
It's because the same thing has surfaced in several languages using
different terms, and those languages have in turn influenced others.
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.
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/