lua-users home
lua-l archive

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

> It seems that there is a tag handler for setglobal but not setlocal. Does
> anyone know a way around this?

Globals are stored in a table, but locals are basically on the stack,
making them much faster.

If you really need to trigger on setting a local variable, create a single
local table and use keys in that table as though they were local variables.
The table will conveniently disappear when you exit the scope. You can then
use the normal set table tag handler.