hlua icon indicating copy to clipboard operation
hlua copied to clipboard

Implement Push for LuaTable

Open linkmauve opened this issue 7 years ago • 1 comments

It’s currently impossible to push a LuaTable value on the stack, which makes it impossible to e.g. return a table from a module, to expose its API publicly in its namespace.

linkmauve avatar Nov 03 '17 01:11 linkmauve

A LuaTable is a borrowed table from a lua context; in particular, borrowing a table requires AsMutLua, because reading and writing values from the table requires manipulating the lua stack. As long as the lua context is borrowed, it isn't guaranteed to be in a consistent state for other operations to be performed. Thus, it isn't actually possible to Push while you have a LuaTable borrowed. A solution might have to take a different form.

tpdickso avatar Nov 08 '17 19:11 tpdickso