Hacker News new | past | comments | ask | show | jobs | submit login

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.



Fortunately, the Vale compiler doesn't allow shadowing. It also says "Did you forget the set keyword?" in case they meant to modify x.


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: