Re: Generating all combinations of length X in an array

2015-04-09 Thread bearophile via Digitalmars-d-learn
wobbles: Have just tested, it is! But with the current D front-end it's not a good idea to generate too many combinations at compile-time. Efficient code doesn't save you from bad usages. Bye, bearophile

Re: Generating all combinations of length X in an array

2015-04-08 Thread bearophile via Digitalmars-d-learn
wobbles: While trying to generate all combinations of length X in an array, I came across the question on stackoverflow. [1] Theres a couple good answers there, but one that caught my eye shows a C# code snippet that is quite nice and short: Often short code is not the best code. Take a

Re: Generating all combinations of length X in an array

2015-04-08 Thread wobbles via Digitalmars-d-learn
On Wednesday, 8 April 2015 at 11:08:00 UTC, wobbles wrote: On Wednesday, 8 April 2015 at 10:54:45 UTC, bearophile wrote: wobbles: While trying to generate all combinations of length X in an array, I came across the question on stackoverflow. [1] Theres a couple good answers there, but one

Generating all combinations of length X in an array

2015-04-08 Thread wobbles via Digitalmars-d-learn
Hi folks, While trying to generate all combinations of length X in an array, I came across the question on stackoverflow. [1] Theres a couple good answers there, but one that caught my eye shows a C# code snippet that is quite nice and short: public static IEnumerableIEnumerableT

Re: Generating all combinations of length X in an array

2015-04-08 Thread wobbles via Digitalmars-d-learn
On Wednesday, 8 April 2015 at 10:54:45 UTC, bearophile wrote: wobbles: While trying to generate all combinations of length X in an array, I came across the question on stackoverflow. [1] Theres a couple good answers there, but one that caught my eye shows a C# code snippet that is quite