lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> For one of my projects I need to reliably change the environment of a function*

One of the best ways to ensure that is to use _ENV in the list of parameters:

function process(_ENV, a, b, c)
...
end

Then just call process(myenv,1,2,3) and all globals in process will be
resolved in myenv.