In fact, code learning is not difficult. Just follow the official documents and learn step by step.
IT technology is better to learn software development, graphic design, architectural design, game animation design, film editing and so on. These techniques are still popular at present. The following is some knowledge of software development.
The 1. programming interface is a standard data format written for some logic.
Is a set of c functions used by the host program to communicate with Lu. All API functions are declared in the header file lua.h according to the related types and constants.
2. Although we are talking about "function", But some simple APIs are provided in the form of macros.
Unless otherwise specified, all these macros only use their parameters once (except that the first parameter must be Lu status), so you don't need to worry about some side effects caused by the expansion of these macros.
3. All Lua API functions in the C library will not check whether the parameters are compatible and valid.
However, you can change this behavior by turning on the macro switch LUA _ use _APICHECK when compiling Lu.
Lu uses a virtual stack to exchange values with C. Every element on the stack is a Lu value (nil, number, string, etc. ).
4. Every time Lua calls C, the called function will get a new stack.
This stack is independent of the C function itself and the previous Lu stack. Contains all the parameters that Lu passed to the c function, and the c function puts the result to be returned on this stack and returns it to the caller.
I hope I can help you, thank you!