lua-users home
lua-l archive

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


Rici,

The lua demo is cool! I'll not do it in C.

I think this mail should be in plain ascii, thanks for the reminder.

Cheers,
Xu

On 02/12/06, Rici Lake <lua@ricilake.net> wrote:
1) Actually, lua_getglobal does not do . resolution.

2) However, there is an undocumented interface in lauxlib,
luaL_findtable(). This doesn't actually do what you want either, but it
shows how you might write such a function in c.

In Lua, it's pretty easy:

function getdotted(field, start)
   start = start or _G
   for k in field:gmatch"[^.]+" do
     start = start[k]
     if start == nil then break end
   end
   return start
end

3) Please figure out how to turn off HTML mail for list submissions

4) Sorry for top-posting