diff --git a/src/ch03-01-variables-and-mutability.md b/src/ch03-01-variables-and-mutability.md index ed15afc0fd..285ccaa3aa 100644 --- a/src/ch03-01-variables-and-mutability.md +++ b/src/ch03-01-variables-and-mutability.md @@ -140,12 +140,15 @@ use of the `let` keyword as follows: ``` This program first binds `x` to a value of `5`. Then, it creates a new variable -`x` by repeating `let x =`, taking the original value and adding `1` so that -the value of `x` is `6`. Then, within an inner scope created with the curly -brackets, the third `let` statement also shadows `x` and creates a new -variable, multiplying the previous value by `2` to give `x` a value of `12`. -When that scope is over, the inner shadowing ends and `x` returns to being `6`. -When we run this program, it will output the following: +that is also called `x`, by repeating `let x =`. The program takes the original +value of `x` and adds `1`, so that the value of the new variable `x` is now `6`. +It is important to understand that the right-hand side is evaluated first `(5 + 1)` +before this value is assigned to the new variable `x`. Then, within an inner +scope created with the curly brackets, the third let statement also shadows `x` +and creates a new variable, evaluating the right-hand side first `(6 * 2)` +before assigning `12` to the new `x`. When that scope is over, the inner +shadowing ends and `x` returns to being `6`. When we run this program, it will +output the following: ```console {{#include ../listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt}}