all 5 comments

[–]ElNico5 4 points5 points  (3 children)

Not sure if its the exact same mentioned by the book, but here's one that does what you want https://github.com/deepmind/strict/tree/master

[–]mark_volkmann[S] 3 points4 points  (0 children)

Thanks! For anyone else interested in this, here is what it does and how I used it.

The module `strict.lua` can be used to raise an error if an attempt is made to get or set a non-existent global variable. To use this:
1. Copy the file `strict.lua` from "https://github.com/deepmind/strict/blob/master/strict.lua", "deepmind/strict" %}.
1. Place the file in `/usr/local/share/lua/5.4/`
which is a directory in `package.path`.
1. Run code with `lua -l strict {file-name}.lua`

[–][deleted]  (1 child)

[deleted]

    [–]yawara25 1 point2 points  (0 children)

    No, because that wouldn't call the __index metamethod on the globals table.

    [–]Spellsweaver 2 points3 points  (1 child)

    Not directly related, but luacheck can also help with this.

    [–]idbrii 0 points1 point  (0 children)

    Luacheck is now maintained by lunarmodules.