[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Call to __len metamethod has userdata/table twice on stack
- From: tobias@...
- Date: Thu, 16 Feb 2017 23:19:41 +0100
Quoting "Soni L." <firstname.lastname@example.org>:
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.