On Thu, Oct 1, 2009 at 9:53 AM, <[email protected]> wrote:
> The Perl 6 equivalent to Perl 5's C<eval {...}> is C<try {...}>.
> (Perl 6's C<eval> function only evaluates strings, not blocks.)
> -A C<try> block by default has a C<CATCH> block that handles all
> +A C<try> block by default has a C<CATCH> block that handles all fatal
> exceptions by ignoring them. If you define a C<CATCH> block within
> the C<try>, it replaces the default C<CATCH>. It also makes the C<try>
> keyword redundant, because any block can function as a C<try> block
OK; so any block with a CATCH block in it is effectively a 'try' block...
> our multi method warn ( Object $o: ) is export
>
> -Prints a warning to C<$*ERR>, which is usually finds C<$PROCESS::ERR>. See
> -C<Synopsis 16: IPC / IO / Signals> for details.
> +Throws a resumable warning exception, which is considered a control
> +exception, and hence is invisible to most normal exception handlers.
> +The outermost control handler will print the warning to C<$*ERR>
> +(which is usually finds C<$PROCESS::ERR>; see C<Synopsis 16: IPC /
> +IO / Signals> for details). After printing the warning, the exception
> +is resumed where it was thrown. To override this behavior, catch the
> +exception in a CONTROL block. A quietly {...} block is the opposite of a
> +try {...} block in that it will suppress any warnings but pass fatal
> +exceptions through.
...while any block with a CONTROL block in it is effectively a
'quietly' block. Right? If so, could this be spelled out in S04,
immediately after the discussion about 'try'?
--
Jonathan "Dataweaver" Lang