Re: help on cartesianProduct()

2016-12-12 Thread Era Scarecrow via Digitalmars-d-learn
On Monday, 12 December 2016 at 14:27:07 UTC, Orut wrote: The code works beautifully! Thank you very much. Will certainly acknowledge you as source of this code if this becomes of part of a bigger project. I hope others searching this forum would also discover this code. It could probably use

Re: help on cartesianProduct()

2016-12-12 Thread Orut via Digitalmars-d-learn
On Sunday, 11 December 2016 at 23:07:16 UTC, Era Scarecrow wrote: On Sunday, 11 December 2016 at 18:05:19 UTC, Era Scarecrow wrote: On Sunday, 11 December 2016 at 16:34:38 UTC, Orut wrote: I need to be able to vary the number of ranges to feed into cartesianProduct() at run time. Hmmm... wha

Re: help on cartesianProduct()

2016-12-11 Thread Era Scarecrow via Digitalmars-d-learn
On Sunday, 11 December 2016 at 18:05:19 UTC, Era Scarecrow wrote: On Sunday, 11 December 2016 at 16:34:38 UTC, Orut wrote: I need to be able to vary the number of ranges to feed into cartesianProduct() at run time. Hmmm... what kind of ranges? Are they going to be arrays? Or something else?

Re: help on cartesianProduct()

2016-12-11 Thread Era Scarecrow via Digitalmars-d-learn
On Sunday, 11 December 2016 at 16:34:38 UTC, Orut wrote: I need to be able to vary the number of ranges to feed into cartesianProduct() at run time. In Python, this is possible because I can dynamically construct a list of lists, then unpack this list using the unpacking operator when it is fed

help on cartesianProduct()

2016-12-11 Thread Orut via Digitalmars-d-learn
Am trying to port some Python code to D and I got stumped on the use of cartesianProduct() from std.algorithm.setops. In Python, the same functionality is implemented by product() in the itertools module. I need to be able to vary the number of ranges to feed into cartesianProduct() at run ti