3 ms·
Are there any languages that use a different syntax for shadowing assignment? As in: Scope 1 let x = 1 let x = 2 => error, rebinding variable in scope
by breatheoften 10y ago
Are there any languages that use a different syntax for shadowing assignment? As in:
Scope 1
let x = 1
let x = 2
=> error, rebinding variable in scope not allowed
Scope 2
let x = 1
shadow x = 2
=> works!
Scope 3
shadow x = 2
=> error: no variable x to shadow declared in scope
I wonder how well something like that would work in practice.