Jump to content

Cartesian product of two or more lists: Difference between revisions

m
m (→‎{{header|Tailspin}}: syntax update)
m (→‎{{header|Tailspin}}: syntax update)
Line 3,318:
<lang tailspin>
templates cartesianProduct
{ product: [$(1)... -> [$]], rest: $(2..-1last) } -> #
<{ rest: <[](0)> }> $.product !
<> def m: $.rest(1);
{ product: [$.product... -> \(def n: $; $m... -> [$n..., $] !\)], rest: $.rest(2..-1last) } -> #
end cartesianProduct
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.