I value the ability to write code in IJulia for example, with as many variables as I feel like, knowing they won’t leak and without using
local all over the place (or enumerating every variable on top of the
If I understand this correctly, this would be gone with the proposal. Is there some tweak that could fix it? What if we added
let to the bag, together with functions, that default to local scope?
Not having a way to mark a piece of code to behave “as if in a function” without wrapping it and running it separately doesn’t feel ideal. One is forced keep track of all the globals at any point, that may be far away, so as not to choose those names and accidentally step over a global.
At this point, as you said, you are convinced there’s no ideal solution. But, we should have easy options to explicity have one behaviour or the other. This proposal, I think, leaves us with only one option.