rzel / kahlua

Automatically exported from code.google.com/p/kahlua
0 stars 0 forks source link

Array Support? #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Can't seem to find any way of managing regular arrays in Lua from Java. The 
interpreter treats arrays as LuaTable, so code-wise it becomes quite messy.

Any further information on this would be greatly appreciated.

Original issue reported on code.google.com by johan.f....@gmail.com on 4 Sep 2010 at 10:32

GoogleCodeExporter commented 9 years ago
there is nothing like this as part of kahlua - same as other kind of Java 
objects. if you want to manage Java arrays, you could either build a "library" 
of functions for array management, or encapsulate arrays in a LuaTable 
implementing object

Original comment by matej...@gmail.com on 4 Sep 2010 at 10:51

GoogleCodeExporter commented 9 years ago
Most likely you're using a converter that converts arrays to LuaTables. This 
actually produces a copy of the array. If you want the plain references to the 
arrays, you could simply stop using that converter.

To enable further assistance, please supply code samples in usage related to 
the issue.

Original comment by kristofer.karlsson@gmail.com on 4 Sep 2010 at 11:32

GoogleCodeExporter commented 9 years ago
I ended up exposing some fields from LuaTable to achieve my goal (reading the 
values array manually as it stores the things i require).

Original comment by johan.f....@gmail.com on 5 Sep 2010 at 2:10