glob is perhaps the prettiest solution, but it isn't recommended for large sets, since all combinations will be generated before any are returned.
So does the comb you wrote.
In reply to Re^2: cartesian product preserving order
by ikegami
in thread cartesian product preserving order
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |