lua-users home
lua-l archive

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


Ignacio,

Yes, you are absolutely right. 

CLNumList:: CLNumList(lua_State *L)
{
        if (lua_isuserdata(L,1))
 {

CLNL*t = static_cast< CLNL*>(lua_touserdata(L, 1));
real_object = new CNumList(*t->pT->real_object);

 }
 else
  real_object = new CNumList();
}

Thanks


2009/10/30 Ignacio Burgueño <ignaciob@inconcertcc.com>
Sivan Thiruvengadam wrote:
Yes. Its being defined there.

const char CLObject::className[] = "CLObject";
Luna< CLObject >::RegType CLObject::methods[] = {
method(CLObject,  GetType),
method(CLObject,  GetListofNumbers),
method(CLObject,  Instance),
{0,0}
};


So this works:
CLObjectInstance = CLObjectI:new()
CLObjectInstance:GetType()

but this does not:

CLObjectInstance = CLObjectI:new()
local clnumlist1 = CLObjectInstance: GetListofNumbers()
CLObjectInstance:GetType()

Am I right?

If so, what does the constructor of CLNumList do? I fear it is messing with 'self'.