This internal module, with the help of the luad.conversions package, takes care of converting between D and Lua types.
The conversion rules are as follows, where conversion goes both ways:
Push a value of any type to the stack.
lua_State* L | stack to push to |
T value | value to push |
Get the associated Lua type for T.
Get a value of any type from the stack.
T | type of value |
typeMismatchHandler | function called to produce an error in case of an invalid conversion. |
lua_State* L | stack to get from |
int idx | value stack index |
Same as calling getValue!(T, typeMismatchHandler)(L, -1), then popping one value from the stack.
Pop a number of elements from the stack.
T | element type |
lua_State* L | stack to pop from |
size_t n | number of elements to pop |
Get a function argument from the stack.
Used for getting a suitable nresults argument to lua_call or lua_pcall.
Pop return values from stack. Defaults to popValue, but has special handling for luad.conversions.functions.LuaVariableReturn, std.typecons.Tuple, static arrays and void.
size_t nret | number of return values |
Push return values to the stack. Defaults to pushValue, but has special handling for luad.conversions.functions.LuaVariableReturn, std.typecons.Tuple and static arrays.
Pops a std.typecons.Tuple from the values at the top of the stack.
Pushes all the values in a std.typecons.Tuple to the stack.
Call a Lua function and handle its return values.
T | type of return value or container of return values |
int nargs | number of arguments |
Print the Lua stack to stdout.