From ce6d9a8377ba80f4635df09c0110a39cceddd995 Mon Sep 17 00:00:00 2001 From: Robin Morisset Date: Wed, 5 Apr 2023 09:06:27 -0700 Subject: Document the scoping rules for try/catch/of/after expressions Fixes #6598. --- system/doc/reference_manual/expressions.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'system') diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 34e622a67e..6b3ba96b6b 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -1938,6 +1938,20 @@ catch exit:Reason -> {'EXIT',Reason} error:Reason:Stk -> {'EXIT',{Reason,Stk}} end + +

Variables bound in the various parts of these expressions have different scopes. + Variables bound just after the try keyword are:

+ + bound in the of section + unsafe in both the catch and after sections, as well as after the whole construct + +

Variables bound in of section are:

+ + unbound in the catch section + unsafe in both the after section, as well as after the whole construct + +

Variables bound in the catch section are unsafe in the after section, as well as after the whole construct.

+

Variables bound in the after section are unsafe after the whole construct.

@@ -2426,4 +2440,3 @@ KeyPattern := ValuePattern <- MapExpression * 1:7: syntax error before: '<'
- -- cgit v1.2.1