Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 3 , claryifying that a mutable variable can be shadowed. #3966

Closed
low-perry opened this issue Jul 3, 2024 · 1 comment
Closed

Chapter 3 , claryifying that a mutable variable can be shadowed. #3966

low-perry opened this issue Jul 3, 2024 · 1 comment

Comments

@low-perry
Copy link

low-perry commented Jul 3, 2024

On chapter 3 , shadowing section the text goes to great lengths to explain the difference between mutability and shadowing, somewhat implying that you can have either/or (not stated anywhere).
I think it would be a good idea to add a note clarifying that you can also shadow a mutable variable and maybe encourage the reader to try it for themselves.

NOTE: It is possible to shadow a mutable variable.

@chriskrycho
Copy link
Contributor

Thanks for the suggestion. I can see how you might have drawn that conclusion, but I don’t think the text does imply that; it simply distinguishes the behavior mutating an existing binding and creating a new one by shadowing. Also, the book is not a reference, but an introduction, so we don’t try to cover every single point we could this way—the physical copy is already pretty huge! Thanks, though.

@chriskrycho chriskrycho closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants