what's good, non-recursive algorithm calculate cartesian product?
note
this rebol-specific question. answer any language.
background
the libel supports origination domain-specific languages famous "dialects" rebol parlance. i've combined such section list comprehensions, aren't natively upheld rebol.
a good cartesian product algorithm indispensable list comprehensions.
the problem
i've used meta-programming solve this, boldly formulating following executing method nested foreach
statements. works beautifully. however, since it's dynamic, formula unequivocally readable. rebol doesn't recursion well. fast runs out smoke-stack space crashes. recursive fortitude out question.
in sum, i wish reinstate meta-programming readable, non-recursive, "inline" algorithm, possible. fortitude any language, enlarged i imitate rebol. (i review only any programming language: c#, c, c++, perl, oz, haskell, erlang, whatever.)
i should highlight algorithm needs support an erratic array sets "joined", given list grasp secure any array sets.
Comments
Post a Comment