lua-users home
lua-l archive

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

a naive question:
> You have to do more like
> lua_pushtable(L)
> lua_pushinteger(L, DEF_SEEED)
> lua_setfield(L, -2, "seed");
> lua_pushvalue(L, -1);
> lua_pushcclosure(L, seedfn, 1);
> lua_pushvalue(L, -1);
> lua_pushcclosure(L, randfn, 1);

when the second "lua_pushvalue(L,-1)" executes, is it duplicating the C-closure to the top?? but the next line needs a table as its upvalue??