Skip to content

Commit

Permalink
Use wording from the manual
Browse files Browse the repository at this point in the history
  • Loading branch information
glennj committed Jan 8, 2025
1 parent 9aa0d70 commit 5e22a8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion concepts/functions/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ If you declare the variables with the `local` command, the _scope_ of the variab
Otherwise, the variable is placed in the _global scope_.

Local variables can have the same name as a global variable.
In that case, the local variable _temporarily_ overrides the global one, and the global value is restored when the function returns.
In that case, the local variable "shadows" the global variable.
For instance, a local variable declared in a function hides a global variable of the same name: references and assignments refer to the local variable, leaving the global variable unmodified.
When the function returns, the global variable is once again visible.

```bash
x=5
Expand Down
4 changes: 3 additions & 1 deletion concepts/functions/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ If you declare the variables with the `local` command, the _scope_ of the variab
Otherwise, the variable is placed in the _global scope_.

Local variables can have the same name as a global variable.
In that case, the local variable takes precedence over the global variable.
In that case, the local variable "shadows" the global variable.
For instance, a local variable declared in a function hides a global variable of the same name: references and assignments refer to the local variable, leaving the global variable unmodified.
When the function returns, the global variable is once again visible.

```bash
x=5
Expand Down

0 comments on commit 5e22a8b

Please sign in to comment.