For example, I want to get all keys or values of certain table.
In vanilla Lua you can do it using pairs function to iterate over table.
How to properly iterate over table on Java side though? Do I need to use run for that? Maybe there's more elegant solution?
Also maybe it's possible to get keys of table on C side properly without any iteration at all?
Case 2:
If I want to insert into table or sort table in Lua I can use table.sort and table.insert. But there's no hooks to do that from Java side. Should I use run in this case too?
Hi. How to properly work with tables in LuaJava?
Case 1:
For example, I want to get all keys or values of certain table. In vanilla Lua you can do it using
pairs
function to iterate over table. How to properly iterate over table on Java side though? Do I need to use run for that? Maybe there's more elegant solution? Also maybe it's possible to get keys of table on C side properly without any iteration at all?Case 2:
If I want to insert into table or sort table in Lua I can use
table.sort
andtable.insert
. But there's no hooks to do that from Java side. Should I userun
in this case too?