Skip to content

Commit 4897e96

Browse files
committed
show my &somefix:<foo> = form
1 parent 12d28f5 commit 4897e96

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/Language/functions.pod6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,13 @@ sub postcircumfix:<!! !!>($left, $inside) {
489489
say 42!! 1 !!; # 42 -> ( 1 )
490490
=end code
491491
492+
Blocks can be assigned directly to operator names. Use a variable declarator and
493+
prefix the operator name with a C<&>-sigil.
494+
495+
my &infix:<ieq> = -> |l { [eq] l>>.fc };
496+
say "abc" ieq "Abc";
497+
# OUTPUT«True␤»
498+
492499
=head2 Precedence
493500
494501
Operator precedence in Perl 6 is specified relatively to existing operators.

0 commit comments

Comments
 (0)