lua-users home
lua-l archive

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


On Thu, May 20, 2010 at 4:48 PM, François Perrad
<francois.perrad@gadz.org> wrote:
>     if debug.setupvalue(debug.getinfo(level, 'f').func, 1, M) ~= '_ENV' then
>         setfenv(level, M) -- Lua 5.1
>     end

You can't keep a good concept down ;)

I also worry about the magic-ness of 1 here, as well as the magic-ness of _ENV.

It's a question of how much sugar a person needs, but

in t do x = 10; y = 20 end

seems easier to read than

do local _ENV = t;  x = 10; y = 20 end

But it can always be a macro ;)

steve d.