lua-users home
lua-l archive

Re: Call to __len metamethod has userdata/table twice on stack

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


Quoting "Soni L." <fakedme@gmail.com>:
Also with unm and bnot:
"For the unary operators (negation, length, and bitwise NOT), the metamethod is computed and called with a dummy second operand, equal to the first one. This extra operand is only to simplify Lua's internals (by making these operators behave like a binary operation) and may be removed in future versions. (For most uses this extra operand is irrelevant.)"
Thanks guys, should have dived deeper into the manual.
 -Tobias

AltStyle によって変換されたページ (->オリジナル) /