From: A LeDonne Date: 2006-05-25T01:23:04+09:00 Subject: Re: rubynuby - confused by method name "inject" On 5/21/06, Logan Capaldo wrote: > > On May 21, 2006, at 1:05 AM, Jeff Pritchard wrote: > > > If I were to choose a synonym for the "inject" method, I might come up > > with "collect". vis. "iterate over these items and collect the > > results > > in one answer." It seems to me that this method does the same thing > > that the big Latin "E" symbol (Epsilon) does in Mathematics. Is > > there a > > name for that symbol within the math community? (I mean - besides > > Epsilon). Calculus and Physics are "twenty some odd years ago" for > > me. > > I think you mean Sigma. And I believe when you don't refer to it as > sigma you say "Summation". > > But I am not a mathematician, so take what I said with a grain of salt. > The big Sigma is often called the n-ary sum operator, and there's a corresponding big Pi called the n-ary product (it can be implemented as inject where the operation in the block is *). So, in math-speak, I think one could say: inject applies a block pairwise as an n-ary operation over an Enumerable, with an optional initial value. This may or may not help anyone understand it. :) -A