rzel / kahlua

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

table.setn and table.getn missing #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
the function pair setn/getn for tables does not exist in kahlua

two solutions come to mind:
a) implement setn/getn in stdlib.lua, use "n" field inside the table.
this solution is good enough for me and i'm sticking with it for now

b) extend LuaTable interface with void setn(int) and int getn(), use private 
int n in LuaTableImpl and expose those functions through TableLib
this might have advantages in non-hash implementations of LuaTable

Original issue reported on code.google.com by matej...@gmail.com on 15 Jun 2010 at 11:55

GoogleCodeExporter commented 9 years ago
hmm... i see in Lua 5.1 spec that setn/getn are deprecated. in that case this 
report is invalid

Original comment by matej...@gmail.com on 15 Jun 2010 at 12:00

GoogleCodeExporter commented 9 years ago
Correct, Kahlua does not intend to be compatible with Lua 5.0, only 5.1 at this 
point. (Possibly 5.2 when it's released)

Original comment by kristofer.karlsson@gmail.com on 15 Jun 2010 at 12:02