Hacker News new | ask | show | jobs
by the_hoser 1902 days ago
This doesn't appear to really do anything to address the one big problem I've had with using Lua for larger applications. Does GopherLua still have global-by-default variables?
1 comments

I've found this to be completely solved by using the strict mode provided by penlight.

It becomes a shallow runtime bug, so it isn't a compiler failure. But I've literally never had a misspelled global stick around for long enough to qualify as a "bug" rather than a mistake. I have polluted the global namespace once or twice by assigning to a new misspelled global in the outermost chunk, which is a little more bugesque, but very seldom.

Neat. I'll try to remember that the next time I need to work with Lua.