[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 4.0 - Tagmethod question
- From: Matt Holmes <kerion@...>
- Date: Tue, 22 Oct 2002 20:54:06 -0500
Thank you for the timely reply, but I have another question ;) I am trying to
create my tagmethod in C, for instance:
int setGlobalTagMethod(lua_State *state)
{
string varname = lua_tostring(state, -2);
int ref = lua_ref(state, 0);
if(varname == "variable")
{
cout << "variable is read-only, cannot write to" << endl;
return 0;
}
lua_getglobals(state);
lua_pushstring(state, varname.c_str());
lua_getref(state, ref);
lua_rawset(state, -3);
return 0;
}
Now I want to set that tagmethod for the tag of that cfunction, but there
doesn't seem to be any kind of lua_gettag method (basically no equivalent to
tag() from the base lib), and I can only lua_settag a tab or userdata. Maybe
I am just missing something basic here ;)
Thanks guys.
Matt
>
> See 3.3 in http://lua-users.org/wiki/RetiredLuaFaq for some ideas.
> --lhf