lua-users home
lua-l archive

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


>Now according to the docs, when the tag handler gets
>called, there should be a table on the stack
>containing the arguments to the function, and the
>first entry should the name of the function that was
>called.

No, the "function" tag method receives all arguments plus the value that
triggered the event, and the value comes first.
If you want all these to go into a table, define your tag method as vararg.

Try this:

 someTbl = { }
 print(someTbl)
 settagmethod(tag(someTbl), "function", function (...) foreachi(arg,print) end)
 someTbl(10,20)

--lhf