File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -591,14 +591,6 @@ Therefore, the subroutine
591
591
592
592
say a for 1..6;
593
593
594
- This works per "clone" of the containing code object, so:
595
-
596
- ({ state $i = 1; $i++.say; } xx 3).map: {$_(), $_()}; # says 1 then 2 thrice
597
-
598
- Note that this is B < not > a thread-safe construct when the same clone of the same
599
- block is run by multiple threads. Also remember that methods only have one
600
- clone per class, not per object.
601
-
602
594
will continue to increment C < $l > and append it to C < @x > each time it is
603
595
called. So it will output
604
596
@@ -613,6 +605,15 @@ called. So it will output
613
605
614
606
= end code
615
607
608
+ This works per "clone" of the containing code object, as in this example:
609
+
610
+ ({ state $i = 1; $i++.say; } xx 3).map: {$_(), $_()}; # says 1 then 2 thrice
611
+
612
+ Note that this is B < not > a thread-safe construct when the same clone of the same
613
+ block is run by multiple threads. Also remember that methods only have one
614
+ clone per class, not per object.
615
+
616
+
616
617
As with C < my > , declaring multiple C < state > variables must be placed
617
618
in parentheses and for declaring a single variable, parentheses may
618
619
be omitted.
You can’t perform that action at this time.
0 commit comments