lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I've got many a table like this:

t = {
    a = function() ... end,
    b = function() ... end

I know need to get an indexed function name from the table.  For index 1, I
need back "a", index 2, "b" and so on.

This can be done with foreach, but is there no way in lua to directly access
a specific item?

Such as:

print(t[1].key) ????


SpriTec Software