Skip to content

Commit

Permalink
Merge pull request #263 from adamijak/main
Browse files Browse the repository at this point in the history
mention shadowing and immutability
  • Loading branch information
fdncred committed Mar 7, 2022
2 parents 1d31c8e + 54cec9a commit 9cce399
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions book/variables_and_subexpressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ If we create a variable, we can print its contents by using `$` to refer to it:
> echo $my-value
4
```
Variables in Nushell are immutable, that means that you can not change its value after declaration.
They can be shadowed in nested block, that results in:

```
> let my-value = 4
> do { let my-value = 5; echo $my-value }
5
> echo $my-value
4
```

## Variable paths

Expand Down

0 comments on commit 9cce399

Please sign in to comment.