3 ms·
Store the environment in "global" table. Make a new environment. Point the __index of the new environment at the global table. Make __newindex of the new enviro
by kazagistar 13y ago
Store the environment in "global" table.
Make a new environment.
Point the __index of the new environment at the global table.
Make __newindex of the new environment a function that throws an error.
Congradulations, you have metaprogrammed lua to only set globals explicitly. Good job!