Hyperoperators (vector processing)
Perl 5:
# pairwise add elements of @a and @b to produce @c
for ($i = 0; $i < @a; $i++) {
$c[$i] = $a[$i] + $b[$i];
}
continued...
| Perl 6 | Perl 6 | #16 |
Perl 5:
# pairwise add elements of @a and @b to produce @c
for ($i = 0; $i < @a; $i++) {
$c[$i] = $a[$i] + $b[$i];
}
continued...
| Copyright © 2008 Patrick Michaud |