lua-users home
lua-l archive

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

>What's the new way of doing C function closures in 4.1?

You make closures the same way: push the upvalues, then call lua_pushcclosure.
What has changed is the way to get upvalues once a function is called.
In 4.0, it was on the stack after the arguments. In 4.1, upvalues are
accessed using pseudo-indices, with lua_upvalueindex(i).