@@ -2415,9 +2415,9 @@ in meaning to declaring the item outside the statement block.
2415
2415
> ** Note** : there is no implicit capture of the function's dynamic environment when
2416
2416
> declaring a function-local item.
2417
2417
2418
- #### Variable declarations
2418
+ #### ` let ` statements
2419
2419
2420
- A _ variable declaration _ introduces a new set of variable , given by a pattern. The
2420
+ A _ ` let ` statement _ introduces a new set of variables , given by a pattern. The
2421
2421
pattern may be followed by a type annotation, and/or an initializer expression.
2422
2422
When no type annotation is given, the compiler will infer the type, or signal
2423
2423
an error if insufficient type information is available for definite inference.
@@ -3190,10 +3190,11 @@ let message = match maybe_digit {
3190
3190
3191
3191
### ` if let ` expressions
3192
3192
3193
- An ` if let ` expression is semantically identical to an ` if ` expression but in place
3194
- of a condition expression it expects a refutable let statement. If the value of the
3195
- expression on the right hand side of the let statement matches the pattern, the corresponding
3196
- block will execute, otherwise flow proceeds to the first ` else ` block that follows.
3193
+ An ` if let ` expression is semantically identical to an ` if ` expression but in
3194
+ place of a condition expression it expects a ` let ` statement with a refutable
3195
+ pattern. If the value of the expression on the right hand side of the ` let `
3196
+ statement matches the pattern, the corresponding block will execute, otherwise
3197
+ flow proceeds to the first ` else ` block that follows.
3197
3198
3198
3199
```
3199
3200
let dish = ("Ham", "Eggs");
@@ -3211,11 +3212,11 @@ if let ("Ham", b) = dish {
3211
3212
3212
3213
### ` while let ` loops
3213
3214
3214
- A ` while let ` loop is semantically identical to a ` while ` loop but in place of a
3215
- condition expression it expects a refutable let statement. If the value of the
3216
- expression on the right hand side of the let statement matches the pattern, the
3217
- loop body block executes and control returns to the pattern matching statement.
3218
- Otherwise, the while expression completes.
3215
+ A ` while let ` loop is semantically identical to a ` while ` loop but in place of
3216
+ a condition expression it expects ` let ` statement with a refutable pattern. If
3217
+ the value of the expression on the right hand side of the ` let ` statement
3218
+ matches the pattern, the loop body block executes and control returns to the
3219
+ pattern matching statement. Otherwise, the while expression completes.
3219
3220
3220
3221
### ` return ` expressions
3221
3222
0 commit comments