Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/src/manual/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@
but gives ```UndefVarError: `x` not defined``` when you try to run it in script or other
file. What is going on is that Julia generally requires you to **be explicit about assigning to global variables in a local scope**.

Here, `x` is a global variable, `while` defines a [local scope](@ref scope-of-variables), and `x += 1` is
an assignment to a global in that local scope.
Here, `x` is a global variable, `while` defines a distinct [local scope](@ref scope-of-variables) for each of its iteration, and

Check warning on line 151 in doc/src/manual/faq.md

View workflow job for this annotation

GitHub Actions / Check whitespace

Whitespace check

trailing whitespace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing white space:

Suggested change
Here, `x` is a global variable, `while` defines a distinct [local scope](@ref scope-of-variables) for each of its iteration, and
Here, `x` is a global variable, `while` defines a distinct [local scope](@ref scope-of-variables) for each of its iteration, and

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each of its iteration

Seems like bad grammar.

`x += 1` is an assignment to a global in one of those local scopes.

As mentioned above, Julia (version 1.5 or later) allows you to omit the `global`
keyword for code in the REPL (and many other interactive environments), to simplify
Expand Down
Loading