Skip to content

Commit 9604d40

Browse files
committed
Add := and ::=. xenoterracide++ benabik++ lizmat++
1 parent 17e8eaf commit 9604d40

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

lib/Language/operators.pod

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,14 +1166,42 @@ well, so the are also checked against the endpoint:
11661166
11671167
=head1 List Prefix Precedence
11681168
1169-
=head2 =
1169+
=head2 infix =
11701170
11711171
List assignment. Its exact semantics are left to the container type on the
11721172
left-hand side. See L<Array> and L<Hash> for common cases.
11731173
11741174
The distinction between item assignment and list assignment is determined by
11751175
the parser depending on the syntax of the left-hand side.
11761176
1177+
=head2 infix :=
1178+
1179+
Binding. Whereas C<$x = $y> puts the value in C<$y> into C<$x>, C<$x :=
1180+
$y> makes C<$x> and C<$y> the same thing.
1181+
1182+
for code :allow<B L>
1183+
my $a = 42;
1184+
my $b B<=> $a;
1185+
$bL<++>;
1186+
say $a;
1187+
1188+
This will output 42, because C<$a> and C<$b> both contained the number
1189+
C<42>, but the L<containers|/language/containters.html#Binding> were
1190+
different.
1191+
1192+
for code :allow<B L>
1193+
my $a = 42;
1194+
my $b B<:=> $a;
1195+
$bL<++>;
1196+
say $a;
1197+
1198+
This will output 43, since C<$b> and C<$a> both represented the same
1199+
object.
1200+
1201+
=head2 infix ::=
1202+
1203+
Read-only binding. See L<C<infix :=>|:=>.
1204+
11771205
=head2 listop ...
11781206
11791207
The I<yada, yada, yada> operator or I<stub> operator. If it is the only

0 commit comments

Comments
 (0)