/
What is the global context in Lua?

What is the global context in Lua?

Lua as a language is very symmetrical in how it is implemented. When we compile a lua program it’s basically inserting values into a Lua table called the global content.

You can access this table from Lua using _G or from the lua_getglobal C function.

 

Related content

Variables
More like this
Variable Scope
Variable Scope
More like this
Why doesn't Lua's C API allow direct pointer access to Lua objects like Python does?
Why doesn't Lua's C API allow direct pointer access to Lua objects like Python does?
More like this
Function scope
Function scope
More like this
User data
User data
More like this
Lua Registry
Lua Registry
More like this