From: Adam Prescott Date: 2010-09-15T05:41:30+09:00 Subject: Re: Iterate over a cartesian product. Whoops, that should be ary.first.product, of course. On Tue, Sep 14, 2010 at 9:40 PM, Adam Prescott wrote: > ary.first is the first element of ary. > ary.product(one, two, ...) is the cartesian product of ary with its arguments. > ary.drop(1) is ary[1..-1], all the elements of ary but the first. > ary.product(*ary.drop(1)) passes each element of ary[1..-1] to > product() as an argument, making it equivalent to > > ary.product(ary[1], ary[2], ..., ary[-1]) > >> >> That looks so cool I wish I knew what it does. >> >> >