I would guess this must have been discussed, so pointers to prior discussions will be appreciated.
Still: what speaks against implementing a new Lua compilation mode where everything must be explicitly declared to be either local or global, and anything not so declared would result in a compilation error?
Cheers,
V.