Cartesian product of two or more lists: Difference between revisions

Content added Content deleted
(→‎{{header|langur}}: updated to use mapX() instead of X())
(Added Easylang)
Line 1,747: Line 1,747:


[]</pre>
[]</pre>
=={{header|EasyLang}}==
{{trans|Go}}
<syntaxhighlight>
proc cart2 a[] b[] . p[][] .
p[][] = [ ]
for a in a[]
for b in b[]
p[][] &= [ a b ]
.
.
.
cart2 [ 1 2 ] [ 3 4 ] r[][]
print r[][]
cart2 [ 3 4 ] [ 1 2 ] r[][]
print r[][]
cart2 [ 1 2 ] [ ] r[][]
print r[][]
cart2 [ ] [ 1 2 ] r[][]
print r[][]
</syntaxhighlight>

=={{header|Erlang}}==
=={{header|Erlang}}==
Can do this with list comprehensions.
Can do this with list comprehensions.
Line 1,766: Line 1,787:
[{3,1},{3,2},{4,1},{4,2}]
[{3,1},{3,2},{4,1},{4,2}]
</pre>
</pre>

=={{header|F Sharp|F#}}==
=={{header|F Sharp|F#}}==
===The Task===
===The Task===