Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
doc [&sub-name] form for meta ops
  • Loading branch information
gfldex committed Jun 29, 2016
1 parent 4932a10 commit 9256c86
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions doc/Language/operators.pod
Expand Up @@ -109,11 +109,12 @@ L<Defining Operators functions|/language/functions#Defining_Operators>.
=head1 Meta Operators
Meta operators can be parameterized with other operators in the same way as
functions can take functions as parameters. Perl 6 will generate the actual
combined operator in the background, allowing the mechanism to be applied
to user defined operators. There are quite a few Meta operators with
different semantics, as explained in detail as follows.
Meta operators can be parameterized with other operators or subroutines in the
same way as functions can take functions as parameters. To use a subroutine as
a parameter prefix it's name with a C<&>. Perl 6 will generate the actual
combined operator in the background, allowing the mechanism to be applied to
user defined operators. There are quite a few Meta operators with different
semantics, as explained in detail as follows.
=head1 Substitution Operators
Expand Down Expand Up @@ -298,6 +299,8 @@ Reduction operators apply any infix operator, surrounded by C<[> and C<]>,
element by element and return the resulting value.
say [+] 1, 2, 3; # 6
sub plus { $^a + $^b };
say [&plus] 1, 2, 3; # 6
They can be defined as a list prefix operators or will be generated automatically.
Expand Down

0 comments on commit 9256c86

Please sign in to comment.