From: "Brian F. Feldman" Date: 2001-01-08T06:35:24+09:00 Subject: [ruby-talk:8785] Re: No :<, :>, etc. methods for Array David Alan Black wrote: > Hello -- > > On Mon, 8 Jan 2001, Brian F. Feldman wrote: > > > Except that I don't really ever see the need for the inject functionality > > itself. A general sum method wouldn't prevent an inject method from being > > created, and I feel it's much more generally important (if it were in > > Enumerable, it feels natural next to min and max). > > > > I know you can define sum in terms of inject, but what is the point of > > having inject if people are just going to use it to create sum? > > You're assuming a lot about what people might or might not do. > Doesn't it make sense, at the level of language/library enhancement, > to think about things with a more general functionality, like inject? > Not that sum would be out of place -- but given that both could exist, > what's the argument against inject? I simply mean that even with a lack of an inject method due to there not being a consensus on the name (personally, I think the name makes no sense, as a native English speaker), it is worth it to have a sum method. I don't mean that inject is useless, but that it shouldn't prevent sum from existing. -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------'