Front page | perl.perl6.language |
Postings from July 2006
[svn:perl6-synopsis] r10470 - doc/trunk/design/syn
From:
audreyt
Date:
July 25, 2006 14:37
Subject:
[svn:perl6-synopsis] r10470 - doc/trunk/design/syn
Message ID:
20060725213731.C4BA7CBA50@x12.develooper.com
Author: audreyt
Date: Tue Jul 25 14:37:31 2006
New Revision: 10470
Modified:
doc/trunk/design/syn/S04.pod
Log:
* S04: CATCH block - grammar and text fix, prompted by gaal++.
Modified: doc/trunk/design/syn/S04.pod
==============================================================================
--- doc/trunk/design/syn/S04.pod (original)
+++ doc/trunk/design/syn/S04.pod Tue Jul 25 14:37:31 2006
@@ -36,7 +36,7 @@
are three ways to declare formal parameters to a closure.
$func = sub ($a, $b) { print if $a eq $b }; # standard sub declaration
- $func = -> $a, $b { print if $a eq $b }; # a "pointy" sub
+ $func = -> $a, $b { print if $a eq $b }; # a "pointy" block
$func = { print if $^a eq $^b } # placeholder arguments
A bare closure without placeholder arguments that uses C<$_>
@@ -456,10 +456,9 @@
of the C<CATCH> block. Handled exceptions break out past this implicit
rethrow.)
-A C<CATCH> block sees the lexical scope in which it defined, but the
-dynamic scope in which it is called, that is, as if it were called
-from the dynamic location that threw the exception. That is, the
-stack is not unwound until some exception handler chooses to
+A C<CATCH> block sees the lexical scope in which it was defined, but
+its caller is the dynamic location that threw the exception. That is,
+the stack is not unwound until some exception handler chooses to
unwind it by "handling" the exception in question. So logically,
if the C<CATCH> block throws its own exception, you would expect the
C<CATCH> block to catch its own exception recursively forever. However,
@@ -495,7 +494,7 @@
return from it. You may only leave the closure block itself with C<leave>
or by falling off the end of it.
-To return a value from a pointy sub or bare closure, you either
+To return a value from a pointy block or bare closure, you either
just let the block return the value of its final expression, or you can
use C<leave>. A C<leave> by default exits from the innermost block.
But you may change the behavior of C<leave> with selector adverbs:
-
[svn:perl6-synopsis] r10470 - doc/trunk/design/syn
by audreyt