...
Oh, I see. You're right, I'd misunderstood you.
However, this still means we end up with the following situation:
a = 1
...56192 lines of code snipped...
function foo()
for b = 1, 10 do ... end
end
foo() has it's own local b. Now I change the first line to:
b = 1
...and now foo() is modifying the outer-scope version. In other words,
making a keyword at the beginning of the file causes a semantic change
in the meaning of some code 56193 lines later --- not ideal if you
want
robust code.
Give that your original suggestion was that global-by-default causes
pollution of the global namespace if you forget to declare a variable,
I'd suggest that this approach to local-by-default causes pollution of
the local namespace instead --- which I think is exactly the same
problem!
- --