[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Setting the environment for a loaded script
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 17 Apr 2014 14:03:10 +0200
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.