[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Function closures in 4.1w3
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 1 Feb 2002 22:46:30 -0200
>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).
--lhf