lua-users home
lua-l archive

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


On Thu, Apr 17, 2014 at 1:51 PM, Milind Gupta <milind.gupta@gmail.com> wrote:
> it to run in the current environment. How should I set the script
> environment and also pass all the current upvalues to the script?

There are two questions here: the first has several straightforward
answers, depending on what Lua version you're using.  The second is
tricky, because upvalues are like locals - they're created at compile
time.  One solution is to capture the upvalues you're interested in
and put them in the custom environment.