[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C functions with shared state
- From: "冶晶邓" <fatfatson@...>
- Date: Tue, 29 May 2007 22:10:16 +0800
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??