From: Marc-Andre Lafortune Date: 2010-03-27T02:59:20+09:00 Subject: [ruby-core:29045] [Feature #3021] Array#product should accept a block. Feature #3021: Array#product should accept a block. http://redmine.ruby-lang.org/issues/show/3021 Author: Marc-Andre Lafortune Status: Open, Priority: Normal Category: core, Target version: 1.9.2 Array#permutation and #combination will yield to the given block, or else return an enumerator. I believe Array#product should have been designed the same way. Returning an enumerator today would break compatibility though. I suggest that Array#product(&block) yields to the block and returns self. This maintains compatibility while making it possible to produce an enumerable with my_array.to_enum(:product, ...) or to avoid building an intermediate array. I could implement this feature in time for code freeze. ---------------------------------------- http://redmine.ruby-lang.org