From: dblack@... Date: 2006-05-22T01:07:57+09:00 Subject: Re: rubynuby - confused by method name "inject" Hi -- On Mon, 22 May 2006, Timothy Hunter wrote: > > On May 21, 2006, at 10:42 AM, Jeff Pritchard wrote: > >> 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 > > No, Matz has said that he wanted to create a language that could be used by > everybody and he realized that it would have to use English. > > Ruby honors its influences by reusing their names. Thus we have the > Smalltalk's "inject", Lisp's "mixin", C's "sprintf" and "puts", Perl's $ > variables, etc. A dubious honor, in the latter case; quoting the ToDo: * discourage use of symbol variables (e.g. $/, etc.) in manual * discourage use of Perlish features by giving warnings. :-) David -- David A. Black (dblack@wobblini.net) * Ruby Power and Light, LLC (http://www.rubypowerandlight.com) > Ruby and Rails consultancy and training * Author of "Ruby for Rails" from Manning Publications! > http://www.manning.com/black