This is very different to shadowing where there is a clear scope to the rebinding. In this case, I cannot employ equational reasoning within a scope but must instead trace back through every intervening statement in the scope to check whether the variable is rebound.
It's a straightforward syntactic transformation. The two are equivalent. The scope of the rebound variable begins at the rebinding and ends when the surrounding scope ends. Perfectly clear - the only difference is a "let" keyword.
counter = 0
...
counter = counter + 1
...
vs
let counter = 0 in
...
let counter = counter + 1 in
...
Sure, scopes are not as easily syntactically visible, but each assignment is creating a new scope, that doesn't change anything for equational reasoning which has to account for captures / substitutions anyways.
Izkata|1 year ago
kreetx|1 year ago
nmadden|1 year ago
tonyg|1 year ago
xavxav|1 year ago