[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to create several closures which share the same upvalues using C API?
- From: Micha <micha-1@...>
- Date: Tue, 06 Jul 2010 09:45:46 +0200
On 06.07.2010 08:46, libla wrote:
> Following codes:
>
> In these closures b and c, method lua_pushcclosure is invalid and cannot
> be used.
>
the docu says that c closures cannot share upvalues, see here:
http://www.lua.org/pil/27.3.3.html
"Unlike Lua closures, C closures cannot share upvalues: Each closure has
its own independent set. However, we can set the upvalues of different
functions to refer to a common table, so that this table becomes a
common place where those functions can share data."
Michael