From: Mathieu Bouchard Date: 2005-03-22T07:09:09+09:00 Subject: Re: Convert a Hash into an Array On Fri, 18 Mar 2005, Derek Wyatt wrote: > | How about #each_with_state for a name? #accumulate (or #accum) is not a > | bad name, but also implies to me that the result will be the > | sum/product/concatenation of values. How would #accum fit for the ri > | example of using #inject to find the longest item in a list, for > | example? Some form of accumulation is one of the more common uses of > | #inject (I gather) but by no means the only use. > Is not #reduce the name we're looking for? Or is it not faithful enough > to lisp to rip off the name? The point with #inject was to be faithful to Smalltalk, which uses that name. Again, I am sorry for having recommended #inject. In GridFlow (my biggest Ruby library), that thing is called #fold. I guess I must have taken the name from Haskell. To me it's more meaningful-sounding than reduce, but your mileage may vary. _____________________________________________________________________ Mathieu Bouchard -=- Montr�al QC Canada -=- http://artengine.ca/matju