_ENV vs _G
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: _ENV vs _G
- From: Mason Mackaman <masondeanm@...>
- Date: 2014年8月11日 11:39:41 -0500
So I was reading the reference manual to try to understand what role _G plays in a Lua program and I’m not having much luck. Adding an element to _G adds it to _ENV, but setting _G=nil doesn’t delete _ENV, so I know they aren’t referencing the same thing. If you do take the time to help this noob out, could you please include in your answer the importance having both _ENV and _G, thanks.