From: jweirich@... Date: 2001-01-08T21:07:20+09:00 Subject: [ruby-talk:8849] Re: No :<, :>, etc. methods for Array >>>>> "Brian" == Brian F Feldman writes: Brian> I know you can define sum in terms of inject, but what is Brian> the point of having inject if people are just going to use Brian> it to create sum? I've used inject (or "reduce") in the following to build a list from scratch ... mods.reduce([]) { |mod,list| local_methods(mod) | list }.sort I use it as often for general things as I do for summing. -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)