Skip to content

Commit

Permalink
Consolidate quietly into statement-prefix.pod6 from control.pod6. (#4151
Browse files Browse the repository at this point in the history
)

* Consolidate quietly into statement-prefix.pod6 from control.pod6.

Planning to change the file name to prefixes.pod6 or modifiers.pod6
unless a better name emerges.

* Improve phrasing around "run-time" and eliminate a <ws>.
  • Loading branch information
0rir committed Dec 28, 2022
1 parent 206df08 commit ea5adc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
16 changes: 0 additions & 16 deletions doc/Language/control.pod6
Expand Up @@ -1159,22 +1159,6 @@ Note that this is B<not> a thread-safe construct when the same clone of the same
block is run by multiple threads. Also remember that methods only have one
clone per class, not per object.
=head1 X<quietly|Control flow,quietly>
A C<quietly> block will suppress all warnings generated in it.
quietly { warn 'kaput!' };
warn 'still kaput!';
# OUTPUT: «still kaput! [...]␤»
Any warning generated from any routine called from within the block will also be
suppressed:
sub told-you { warn 'hey...' };
quietly { told-you; warn 'kaput!' };
warn 'Only telling you now!'
# OUTPUT: «Only telling you now!␤ [...] ␤»
=head1 LABELs
Expand Down
10 changes: 6 additions & 4 deletions doc/Language/statement-prefixes.pod6
Expand Up @@ -80,16 +80,18 @@ don't care.
=head2 X<C<quietly>|Syntax,quietly (statement prefix)>
As a statement prefix, C<quietly> suppresses all warnings produced by the
statement it precedes.
As a prefix, C<quietly> suppresses all run-time warnings produced by the
block or statement it precedes.
=for code
sub marine() {};
quietly say ~&marine; # OUTPUT: «marine␤»
sub told-you { warn 'hey...' };
quietly { told-you; warn 'kaput!' };
warn 'Telling you now!'; # OUTPUT: «Telling you now!␤ [...] ␤»
Calling L<C<.Str> on C<code> produces a warning|/type/Code#method_Str>.
Preceding the statement with C<quietly > will just produce the output, the name
of the routine.
Preceding the code with C<quietly> will just produce the output without warning.
=head2 X<C<try>|Syntax,try (statement prefix)>
Expand Down

0 comments on commit ea5adc5

Please sign in to comment.