From b2e29698f78f56ebffee10d503a66e4929ad8f59 Mon Sep 17 00:00:00 2001 From: schultzdavid Date: Fri, 14 Nov 2025 13:21:31 +0000 Subject: [PATCH 1/5] remove `CATCH` keyword where all that matters is the block --- doc/Language/exceptions.rakudoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Language/exceptions.rakudoc b/doc/Language/exceptions.rakudoc index 57ceda3b0..1c2dff8ad 100644 --- a/doc/Language/exceptions.rakudoc +++ b/doc/Language/exceptions.rakudoc @@ -144,7 +144,7 @@ the code> in the enclosing block will never be executed. Compare with this: - CATCH { + { CATCH { default { .Str.say; } From fee451bd4971123497076da39b8941548a26fc46 Mon Sep 17 00:00:00 2001 From: schultzdavid Date: Fri, 14 Nov 2025 13:55:10 +0000 Subject: [PATCH 2/5] fix sentence beginning & dash --- doc/Language/exceptions.rakudoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Language/exceptions.rakudoc b/doc/Language/exceptions.rakudoc index 1c2dff8ad..cdc887d5e 100644 --- a/doc/Language/exceptions.rakudoc +++ b/doc/Language/exceptions.rakudoc @@ -246,7 +246,7 @@ Which would output: in block at exception.raku line 21 =end code -Since the C block is handling just the L|/type/X::AdHoc> exception +This is because the C block is handling just the L|/type/X::AdHoc> exception thrown by the C statement, but not the C exception. In the absence of a C block, all exceptions will be contained and dropped, as indicated above. C will resume execution right after @@ -255,7 +255,7 @@ Please consult the section on L for more information on this. -A C-block is a normal block and as such treats its last statement +A C block is a normal block and as such treats its last statement as the return value of itself. We can therefore use it as a right-hand side. From cb96f148f510b41afe67c3e8fe4f5bb5cfc03910 Mon Sep 17 00:00:00 2001 From: schultzdavid Date: Fri, 14 Nov 2025 14:25:15 +0000 Subject: [PATCH 3/5] reword sentence on return value of `try` block --- doc/Language/exceptions.rakudoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Language/exceptions.rakudoc b/doc/Language/exceptions.rakudoc index cdc887d5e..b7e29a4d2 100644 --- a/doc/Language/exceptions.rakudoc +++ b/doc/Language/exceptions.rakudoc @@ -255,8 +255,8 @@ Please consult the section on L for more information on this. -A C block is a normal block and as such treats its last statement -as the return value of itself. We can therefore use it as a right-hand +A C block is a normal block and as such, uses its last statement +as its return value. We can therefore use it as a right-hand side. =begin code From 89294e771cc8705a36839d0db7296e5846d8e8f4 Mon Sep 17 00:00:00 2001 From: schultzdavid Date: Fri, 14 Nov 2025 20:42:58 +0000 Subject: [PATCH 4/5] remove empty line --- doc/Language/exceptions.rakudoc | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/Language/exceptions.rakudoc b/doc/Language/exceptions.rakudoc index b7e29a4d2..3d596d2fa 100644 --- a/doc/Language/exceptions.rakudoc +++ b/doc/Language/exceptions.rakudoc @@ -391,7 +391,6 @@ sub bad-sub { say "Error ", .^name, ': ',.Str; $return = '0'; .resume; - } } } From 7edcb48072a7552166f9209f0f693062c2826409 Mon Sep 17 00:00:00 2001 From: schultzdavid Date: Fri, 14 Nov 2025 20:48:57 +0000 Subject: [PATCH 5/5] add space --- doc/Language/exceptions.rakudoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Language/exceptions.rakudoc b/doc/Language/exceptions.rakudoc index 3d596d2fa..a059d5d19 100644 --- a/doc/Language/exceptions.rakudoc +++ b/doc/Language/exceptions.rakudoc @@ -388,7 +388,7 @@ sub bad-sub { say "Returned $return"; CATCH { default { - say "Error ", .^name, ': ',.Str; + say "Error ", .^name, ': ', .Str; $return = '0'; .resume; }