Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Last in version-controlled changes.
This refs #2632, on with the next block.
  • Loading branch information
JJ committed Mar 2, 2019
1 parent 2b8a006 commit f0751d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion doc/Language/control.pod6
Expand Up @@ -154,7 +154,17 @@ start { sleep 1; say "done" }
say "working";
# working, done
Note that you need a space between the C<start> and the block.
Note that you need a space between the C<start> and the block. In the example above, the C<start> block is in sink context, since it's not assigned to a variable. From version 6.3, these kind of blocks have an exception handler attached:
=for code :skip-test<Illustrates exception>
start { die "We're dead"; }
say "working";
sleep 10;
This code will print C<Unhandled exception in code scheduled on thread 4 We're
dead> in version 6.d, while it will simply get out after waiting for 10 seconds
in version 6.c.
The C<start {...}> immediately returns a C<Promise> that can be safely ignored
if you are not interested in the result of the block. If you B<are> interested
Expand Down

0 comments on commit f0751d9

Please sign in to comment.