From: David Alan Black Date: 2001-01-08T06:13:22+09:00 Subject: [ruby-talk:8783] Re: No :<, :>, etc. methods for Array 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? David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav