Product with filters

cool.
Have you added this to the Rubygarden wiki? …preferably under algorithms?

martindemello@yahoo.com [mailto:martindemello@yahoo.com] said:

A modification of Joel VanderWerf’s

EnumerableOperator#product to include

restrictions (‘select’ style filters that are applied as

the product is # constructed). Behaviour defaults to the
Cartesian product when no filters are # given. (List
comprehension envy again ) #

The argument list consists of a mixture of factors

(Enumerable objects) # and restrictions (procs returning a boolean).

Factors appear in order; restrictions are sorted by arity,

so that a # restriction of arity n is applied after the nth
element in every tuple is # added.

[snipped code]

As soon as I figure my way around the wiki :slight_smile: By algorithms I take it
you mean http://www.rubygarden.org/ruby?RubyAlgorithmPackage?

martin

···

“Pe?a, Botp” botp@delmonte-phil.com wrote:

cool.
Have you added this to the Rubygarden wiki? …preferably under algorithms?