News for hackers. Stuff that matters.
Re:The Value in Go’s Simplicity by zeeboo on Saturday November 16, 2019 @12:31PM (#21553783)
There's no shadowing in the latter case. The second case is the same thing as

    a := 2
    a = 3
By definition you must have nested scopes to have shadowing. Within the same scope, it's only ever assignment.
Re:The Value in Go’s Simplicity by couchand on Saturday November 16, 2019 @11:15PM (#21556534)
Well, in Rust you could do:

    let a = 2;
    let a = 3;
I think you would say the latter shadows the former...
Re:The Value in Go’s Simplicity by zeeboo on Tuesday November 19, 2019 @11:58PM (#21581216)
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.