lua-users home
lua-l archive

Re: setfenv/getfenv

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


On Tue, Jan 12, 2010 at 02:18:21PM -0200, Roberto Ierusalimschy wrote:
> > To do this, I create an environment consisting of just the functions I want
> > exposed; then loadfile() the script, set the environment and then run the
> > function. [...]
> 
> If I undestood you correctly, this is precisely the goal of the new
> function 'loadin'.
So this would be blah = loadin(pathtoscript, envtab) rather than blah =
loadfile(pathtoscript) setfenv(blah, envtab) ? That seems emminently
reasonable and pleasant to use.
Thanks,
Daniel.
-- 
Daniel Silverstone http://www.digital-scurf.org/
PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69

AltStyle によって変換されたページ (->オリジナル) /