Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tedunangst
on April 21, 2022
|
parent
|
context
|
favorite
| on:
On removing let and let mut
I'd be very worried about accidental shadowing.
x = 4 if (cond) { x = 8 log("x is now: ", x) } process(x)
Looks right, but it's wrong.
verdagon
on April 21, 2022
[–]
Fortunately, the Vale compiler doesn't allow shadowing. It also says "Did you forget the set keyword?" in case they meant to modify x.
renox
on April 23, 2022
|
parent
[–]
I'm surprised: in Rust they allow variable shadowing because otherwise with the 'immutable by default' design they thought that you'd have to create too many names.
Isn't it an issue for Vale?
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: