Make product consistently yield an array of N elements instead of N arguments
Inconsistency pointed out by @mame (Yusuke Endoh):
>> Enumerator.product([1], [2], [3]).to_a => [[1, 2, 3]] >> Enumerator.product([1], [2]).to_a => [[1, 2]] >> Enumerator.product([1]).to_a => [1] >> Enumerator.product().to_a => [nil]
Got fixed as follows:
>> Enumerator.product([1], [2], [3]).to_a => [[1, 2, 3]] >> Enumerator.product([1], [2]).to_a => [[1, 2]] >> Enumerator.product([1]).to_a => [[1]] >> Enumerator.product().to_a => [[]]
This was due to the nature of the N-argument funcall in Ruby.
Make product consistently yield an array of N elements instead of N arguments
Inconsistency pointed out by @mame (Yusuke Endoh):
Got fixed as follows:
This was due to the nature of the N-argument funcall in Ruby.