Skip to content

Commit 222231f

Browse files
authored
Move error comment line in scoping example (#54790)
Continuation of #54500. I realized the erroring line is one lower.
1 parent 3054c00 commit 222231f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/src/manual/variables-and-scoping.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ a global variable by the same name is allowed or not.
3131
```julia
3232
# Print the numbers 1 through 5
3333
i = 0
34-
while i < 5 # ERROR: UndefVarError: `i` not defined
35-
i += 1
34+
while i < 5
35+
i += 1 # ERROR: UndefVarError: `i` not defined
3636
println(i)
3737
end
3838
```
@@ -43,8 +43,8 @@ a global variable by the same name is allowed or not.
4343
```julia
4444
# Print the numbers 1 through 5
4545
let i = 0
46-
while i < 5 # Now `i` is defined in the inner scope of the while loop
47-
i += 1
46+
while i < 5
47+
i += 1 # Now outer `i` is defined in the inner scope of the while loop
4848
println(i)
4949
end
5050
end

0 commit comments

Comments
 (0)