Skip to content

Commit

Permalink
Some reflow and rewriting
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Apr 30, 2019
1 parent 3726ed0 commit 4cc3ab1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions doc/Language/pragmas.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
=TITLE Pragmas
=SUBTITLE Special modules for special use
=SUBTITLE Special modules that define certain aspects of the behavior of the code
In Perl 6, B<pragmas> are directive used to either identify a specific
version of Perl 6 to be used or to modify the compiler's normal behavior
Expand Down Expand Up @@ -36,11 +36,12 @@ use v6.c; # Use the "Christmas" version of Perl 6
=for code :solo
use v6.d; # Use the "Diwali" version of Perl 6
From 2018.11, which implemented 6.d, this pragma does not do anything.
=for code :solo
use v6.d.PREVIEW; # On 6.d-capable compilers, enables 6.d features,
# otherwise enables the available experimental
# preview features for 6.d language
# This will only work on releases previous to 6.d.
Since these pragmas turn on the compiler version, they should be the
first statement in the file (preceding comments and Pod are fine).
Expand Down Expand Up @@ -82,10 +83,11 @@ X<|fatal, pragma>
=head2 fatal
A lexical pragma that makes L<Failures|/type/Failure> returned from routines
fatal. For example, prefix C<+> on a L<Str|/type/Str> coerces it to L<Numeric|/type/Numeric>, but will
return a L<Failure|/type/Failure> if the string contains non-numeric characters. Saving that
L<Failure|/type/Failure> in a variable prevents it from being sunk, and so the first code
block below reaches the C<say $x.^name;> line and prints C<Failure> in output.
fatal. For example, prefix C<+> on a L<Str|/type/Str> coerces it to
L<Numeric|/type/Numeric>, but will return a L<Failure|/type/Failure> if the
string contains non-numeric characters. Saving that L<Failure|/type/Failure> in
a variable prevents it from being sunk, and so the first code block below
reaches the C<say $x.^name;> line and prints C<Failure> in output.
In the second block, the C<use fatal> pragma is enabled, so the C<say> line is
never reached because the L<Exception|/type/Exception> contained in the L<Failure|/type/Failure> returned from
Expand Down

0 comments on commit 4cc3ab1

Please sign in to comment.