diff options
Diffstat (limited to 'perl9.buetow.org/content/Extended-Features.sub/Megahyper-Operators.xml')
| -rw-r--r-- | perl9.buetow.org/content/Extended-Features.sub/Megahyper-Operators.xml | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/perl9.buetow.org/content/Extended-Features.sub/Megahyper-Operators.xml b/perl9.buetow.org/content/Extended-Features.sub/Megahyper-Operators.xml deleted file mode 100644 index 7bcd5a1..0000000 --- a/perl9.buetow.org/content/Extended-Features.sub/Megahyper-Operators.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?> -<content> - <pagetitle>Hyper- mega hyper and mega mega hyper!</pagetitle> - <text>You probably already know the so called Hyperoperators of Perl 6!</text> - <code> -# This code -my @baz = @foo >>+<< @bar; - -# Is the same as: -loop ($i = 0; $i < @bar.elems; ++$i) { - push @baz, @foo[$i] + @bar[$i]; -} - </code> - <text>A mega hyper operator takes you to the next level:</text> - <code> -# This code -my @baz = @foo >>>>+<<<< @bar; - -# Is the same as: -loop ($i = 0; $i < @bar.elems; ++$i) { - my $foo = @foo[$i]; - my $bar = @bar[$i]; - my $baz = @baz[$i]; - loop ($j = 0; $j < $bar->elems; ++$j) { - push @$baz, $foo->[$j] + $bar->[$j]; - } -} - </code> - <text>And a mega mega hyper operator does this:</text> - <code> -# This code -my @baz = @foo >>>>>>+<<<<<< @bar; - -# Is the same as: -loop ($i = 0; $i <&t; @bar.elems; ++$i) { - my $foo = @foo[$i]; - my $bar = @bar[$i]; - my $baz = @baz[$i]; - loop ($j = 0; $j < $bar->elems; ++$j) { - my $foo_ = $foo->[$j]; - my $bar_ = $bar->[$j]; - my $baz_ = $baz->[$j]; - loop ($k = 0; $k < $bar_->elems; ++$k) { - push @$baz_, $foo_->[$k] + $bar_->[$k]; - } - } -} - </code> - <text>Etc... As you can see, its helping you to write less code!</text> -</content> |
