* Brian Schrder <ruby.brian / gmail.com> [2005-07-28 23:21:29 +0900]:

> On 28/07/05, Jim Freeze <jim / freeze.org> wrote:
> > * Ara.T.Howard <Ara.T.Howard / noaa.gov> [2005-07-28 23:11:32 +0900]:
> > 
> > >   cross = foo.inject(a=[]){|a,f| bar.inject(a){|a,b| a << [f,b]}}
> > 
> > Wow, that's great. But my brain hurts.
> 
> > foo.inject([]){ |result,a| bar.inject(result){ |result,b| result << [a,b] }}
> => [[1, "a"], [1, "b"], [1, "c"], [2, "a"], [2, "b"], [2, "c"], [3,
> "a"], [3, "b"], [3, "c"]]

Nice. Brain feel better.

-- 
Jim Freeze