diff options
| author | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-28 17:05:48 +0200 |
|---|---|---|
| committer | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-28 17:05:48 +0200 |
| commit | c592d7100b95124e6042563fc20d66a2966f3267 (patch) | |
| tree | 15c68ef0a106fb4a5523893d8d48a88dd301c4e0 /perl9.buetow.org/content/Extended-Features.sub/Megahyper-Operators.xml | |
| parent | f3edcebfc981ac077bcd61aac2dd3d1682c41bc2 (diff) | |
foo
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> |
