lua-users home
lua-l archive

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


On Sunday, September 14, 2014 05:18:50 PM Coda Highland wrote:
> I can't imagine any way it wouldn't be a bug if you did do it, but a
> realistic way I could see such a thing arising unintentionally is
> like:
> 
> tbl[a], tbl[b], tbl[c] = k1, k2, k3
> 
> where a, b, and c are determined by some logic external to the
> function. If any of a, b, or c are the same value, you trigger this
> behavior.

Also relevant when __newindex is defined on the metatable and has side-
effects.

But I think you'd have to be some kind of sadist to put side-effects in a 
metatable function. Nothing obfuscates a program more than when what looks 
like a simple `=' sign means more than just assign a value to the lvalue.

-- 
tom <telliamed@whoopdedo.org>