in reply to Re: cartesian product preserving order
in thread cartesian product preserving order

TedPride,
...but it isn't recommended for large sets, since all combinations will be generated before any are returned.

What makes you think that? In scalar context, glob becomes an iterator. That isn't how it was used, but it could have been. How is a recursive solution any better - it builds the entire solution in memory before returning it.

Cheers - L~R

  • Comment on Re^2: cartesian product preserving order