Skip to content

Commit b38f74d

Browse files
committed
Sum with Junctions #2632
1 parent 19aa6de commit b38f74d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/Type/List.pod6

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,13 @@ Throws an exception if an element can not be coerced into Numeric.
12891289
say (1, "0xff").sum; # OUTPUT: «256␤»
12901290
say sum(0b1111, 5); # OUTPUT: «20␤»
12911291
1292-
When being called on native integer arrays, it is also possible to specify
1292+
If the list includes a C<Junction>, the result will accordingly be a
1293+
C<Junction>:
1294+
1295+
=for code
1296+
say ( 1|2, 3).sum; # OUTPUT: «any(4, 5)␤»
1297+
1298+
When called on native integer arrays, it is also possible to specify
12931299
a C<:wrap> named parameter. This will add the values as native integers,
12941300
wrapping around if they exceed the size of a native integer. If you are
12951301
sure you will not exceed that value, or if you don't mind, using C<:wrap>

0 commit comments

Comments
 (0)