Skip to content

Commit

Permalink
Move error comment line in scoping example (#54790)
Browse files Browse the repository at this point in the history
Continuation of #54500.
I realized the erroring line is one lower.
  • Loading branch information
nathanrboyer committed Jun 14, 2024
1 parent 3054c00 commit 222231f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/src/manual/variables-and-scoping.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ a global variable by the same name is allowed or not.
```julia
# Print the numbers 1 through 5
i = 0
while i < 5 # ERROR: UndefVarError: `i` not defined
i += 1
while i < 5
i += 1 # ERROR: UndefVarError: `i` not defined
println(i)
end
```
Expand All @@ -43,8 +43,8 @@ a global variable by the same name is allowed or not.
```julia
# Print the numbers 1 through 5
let i = 0
while i < 5 # Now `i` is defined in the inner scope of the while loop
i += 1
while i < 5
i += 1 # Now outer `i` is defined in the inner scope of the while loop
println(i)
end
end
Expand Down

0 comments on commit 222231f

Please sign in to comment.