Top "Lua-5.2" questions

Some new features are yieldable pcall and metamethods, new lexical scheme for globals, ephemeron tables, finalizers for tables etc.

"For each" loop in a lua table with key value pairs

Say I have a table defined like this: myTable = { myValue = nil, myOtherValue = nil} How would I iterate through it in …

lua lua-5.2
How to dump lua function chunk to string?

How to dump lua function chunk to string ? function test(a, b) local c = a + b return c end print( …

lua lua-5.2
luaL_openlib replacement for Lua 5.2

I am adapting a library written for Lua < 5.2 and got to a call I don't know the equivalent of: …

c lua embedding lua-5.2
Get n-th element from end of list (table)

If I have a list (table): local list = {'foo', 'bar', 'baz', 'qux'} How do I get the n-th item from …

arrays list lua lua-table lua-5.2