File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,21 @@ that point.
272
272
42 # this is the return value
273
273
}
274
274
275
+ B < Note: > be mindful of C < LEAVE > phasers directly in blocks of routines, as
276
+ they will get executed even when an attempt to call the routine with wrong
277
+ arguments is made:
278
+
279
+ sub foo (Int) {
280
+ say "Hello!";
281
+ LEAVE say "oh noes!"
282
+ }
283
+ try foo rand; # OUTPUT: «oh noes!»
284
+
285
+ Although the subroutine's body did not get run, because the sub expects
286
+ an L < Int > and L « C < rand > |/routine/rand» returned a L < Num > , its block was
287
+ entered and left (when param binding failed), and so the C < LEAVE > phaser
288
+ I < was > run.
289
+
275
290
= head2 X < KEEP|Phasers >
276
291
277
292
Runs at every successful block exit, as part of the LEAVE queue (shares the
You can’t perform that action at this time.
0 commit comments