What are Function Environments?
setfenv can set the environment for a function. Normally, the environment for a function is the global table, but this can be changed. This is very useful for sandboxing, because you can control the context in which code is executed, and prevent that code from doing anything nasty. It is also used to implement module scope.
setfenv can set the environment for a function. Normally, the environment for a function is the global table, but this can be changed. This is very useful for sand boxing, because you can control the context in which code is executed, and prevent that code from doing anything nasty. It is also used to implement module scope.