The 'pairs' mechanism is easy enoug to use in Lua code. I'm just
wondering if there's a good way of doing the same from C.
See
http://www.lua.org/manual/5.1/manual.html#lua_next
Be VERY careful not to modify the key during traversal. In particular,
lua_isnumber() and lua_isstring() modify their args, or at least they
did in 5.0, I don't see specific mention of this in:
http://www.lua.org/manual/5.1/manual.html#lua_isstring