lua-users home
lua-l archive

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


Lua5.2 has a new _ENV mechanism, it's simpler than previous global mechanism. and we can write
do
    local _ENV = ...
    -- codes
end

to set a septate env for code chunks.

but at a most times, we need import standard functions into the new _ENV, e.g. print, pairs, etc. may we register all these std-function into a pre-defined table?

may it named _PRIM or _BASE or _BUILTIN, and we can generate new env table easily.

or we can put this table into stdlib library.