What I don't understand about the Perl6 solution is the need to count how many elements will be returned.sub cross { my @r = []; @r = map {my $l = $_; map {[@$_, $l]} @r} @$_ for @_; @r; }
In reply to Re^3: cross combinations
by Perl Mouse
in thread cross combinations
by jql
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |