Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, in Rust you could do:

    let a = 2;
    let a = 3;
I think you would say the latter shadows the former...


Indeed, because semantically there is a syntactically implicit scope for every let binding. For example, in that case, the outer a is dropped after the inner a, just as if the second a had been inside of a block. There may be multiple syntactic ways to introduce a new scope.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: