lua-users home
lua-l archive

Re: _ENV vs _G

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



On Aug 12, 2014, at 8:48 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:

4. If you compile a function using `load` or `loadstring`, its _ENV is one of:
a. An _ENV parameter.
b. The _ENV specified in the `load`.
c. An _ENV upvalue.

I think it’s always either the distinguished environment (the one stored in the registry at a well-known key) or the explicit table specified as an argument to load().

—Tim


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