lua-users home
lua-l archive

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


On Thu, Feb 18, 2010 at 11:48 PM, Geoff Leyland
<geoff_leyland@fastmail.fm> wrote:
>> local env = {}
>> local f = assert (loadfile ("config.lua"))
>> setfenv (f, env) ()
>>
>> ... which lets you load a configuration file into a table, will no longer work under Lua 5.2.
>
> I do exactly this too.  It'd be a shame if 5.2 broke it.

Do remember that loadin can also be passed a code string (like
loadstring) but then I guess you still have to have io.read().

Although surely this is not the kind of thing you would do in a sandbox?

steve d.