lua-users home
lua-l archive

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


On Nov 10, 2011, at 11:48 AM, Miles Bader wrote:

>> load (ld [, source [, mode [, env]]])
> 
> Yeah, but as I mentioned, "load" is kind of annoying to use; having
> "loadfile" take an (optional) environment parameter would be much
> nicer.

Yeah, perhaps a one line utility function of your own would go a long way to keep you happy :))

assert( load( io.open( 'Test.lua', 'rb' ):lines(), 'Test', 't', _G ) )