From: Jeff Pritchard Date: 2006-05-21T23:42:09+09:00 Subject: Re: rubynuby - confused by method name "inject" Following David's suggestion, I think I'll go ahead and use it, but always precede it with a comment so I can remember what it does when I come back to it later. Something like: # this "inject" method is "combining" the results from the block operation into a single answer [1,2,3,4,5].inject(0){|sum,num|sum+num} This topic makes me wonder, and perhaps one of the old-timers here can answer this. If I understand it correctly, Matz basically "invented" ruby. Matz is, as far as I know, Japanese. Was Ruby first written with Japanese class and method names and later translated to English? Or did it start out in English? thanks, jp ReggW wrote: > Jeff Pritchard wrote: >> Can anybody explain to me how the Enumberable#inject method is >> "injecting" something into something? I find it very difficult remember >> method names when I don't "get" them. So far in Ruby, "inject" takes >> the cake for least understandable method name (with my own particular >> convoluted gray matter). > > I agree!!!! > > > I have it marked in my "Ruby notes", as "Don't use". > I do this so that when I come across it again, I won't spend 2 hours > trying to make sense out of it's purpose. -- Posted via http://www.ruby-forum.com/.