lua-users home
lua-l archive

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


Steve Dekorte <steve@dekorte.com> wrote:
> But the that will only get called when a global is set to "nil".
> And according to the Lua documentation, it cannot be set for other data types:
> 
>    4.8 Tag Methods
>    ...
>    ``setglobal'':
>    called whenever Lua assigns to a global variable. 
>    This method cannot be set for numbers, strings, and tables and 
>    userdata with default tags.
> 
> 
> I need a setglobal fallback that will get called regardless of type. 
> Can Lua do that?

My mistake, it's the opposite of what I thought. 
It only get's called with the oldvalue is nil. 

Steve