lua-users home
lua-l archive

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


> Basically, you may do
> 
>   for k,v in pairs(math) do _G[k] = v end

In C that could be simpler:

   lua_pushvalue(L,LUA_GLOBALSINDEX);	/* open math in global scope */
   lua_setglobal(L,LUA_MATHLIBNAME);
   luaopen_math(L);
   lua_pushnil(L);			/* remove math */
   lua_setglobal(L,LUA_MATHLIBNAME);

This is what my ae does:
	http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#ae