[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: c api to create local or upvalues?
- From: Hao Wu <wuhao.wise@...>
- Date: Wed, 3 Aug 2011 13:01:33 -0700
I am trying to do something like "this" pointer in c++. now I make it
global variable, which works fine, but the problem is that when I
enclose a local function, the this pointer won't be deduced into
upvalues, because it is global variable. this can be fixed by adding a
local this = this;
but it is sort of error-prone. it always causes troubles and hard to
detect. so I am looking for a more robust way where I can set "this"
as a local variable programmatically and it encloses itself.
Any idea is greatly appreciated!