GOTO Kentaro wrote: > In message "[ruby-talk:8780] Re: No :<, :>, etc. methods for Array" > on 01/01/08, "Brian F. Feldman" <green / FreeBSD.org> writes: > >class Array > > def sum > > total = self[0] # defaults to nil > > self[1..-1].each {|x| total += x} > > total > > end > >end > > > >It simplifies lots of things (especially mathematics) in Ruby to have it, > >and I believe it's generally useful enough that it should probably be > >standard. What do you think? > > See: > http://www.rubycentral.com/faq/rubyfaq-11.html#ss11.4 > > `Enumerable#inject' is introduced there. That may be adopted if an > apter method name is proposed. You mean this isn't in the 1.7 queue? I thought we had previously agreed that 'reduce' was the most appropriate term, largely because this was compatible with the predominant math and comp. sci jargon, as monumentalized by various ancient-to-modern programming languages (such as Lisp, APL, Slim, ML, and Python). Also, wasn't there some tangentally related discussion about adding something like Python's (and ML's?) zip method? Conrad Schneiker (This note is unofficial and subject to improvement without notice.)