I don't yet understand the stack
This commit is contained in:
parent
d8fcd648d7
commit
e35454c9a8
|
@ -378,6 +378,9 @@ int main (int argc, char **argv) {
|
|||
}
|
||||
initscr();
|
||||
echo();
|
||||
lua_pushinteger(L, 42);
|
||||
lua_setfield(L, -1, "answer");
|
||||
//? lua_setglobal(L, "answer");
|
||||
s.argc = argc;
|
||||
s.argv = argv;
|
||||
status = lua_cpcall(L, &pmain, &s);
|
||||
|
|
|
@ -9,9 +9,5 @@ lua_State:
|
|||
GCObject* next
|
||||
byte tt # type == THREAD
|
||||
|
||||
initializing a lua_State (lua_newstate)
|
||||
allocate space (including for globals)
|
||||
next = NULL
|
||||
stack = NULL
|
||||
|
||||
Lua's stack vs globals: https://lucasklassmann.com/blog/2019-02-02-how-to-embeddeding-lua-in-c/#exposing-a-simple-variable
|
||||
More info on the stack: https://www.lua.org/pil/24.2.html
|
||||
|
|
Loading…
Reference in New Issue