lua-users home
lua-l archive

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


I am having a hard time wrapping my head around exactly what the function tag 
method is supposed to be for.

I have a table, we will call it t with the tag 7 (from lua_newtag()). That 
table contains a field called "testMethod" which contains the value 
"__funcref__", thus making it a string value.

I have set the "function" tag method for the tag 7 using something like this:
lua_pushcfunction(state, funcPtr);
lua_settagmethod(state, tag, "function");

tag is equal to 7 in this case (the same tag used when I do lua_settag() for 
the table).

but when I do the following in a test script:
t:testMethod()

the function tag method is never invoked, I simply get the standard error 
about not being able to call a string value. Am I using the function tag 
method incorrectly, or am I just minterpreting its meaning?

Thanks,

Matt Holmes