[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Strange Lua behavior with __eq return values
- From: "Leo Razoumov" <slonik.az@...>
- Date: Fri, 21 Nov 2008 08:10:08 -0500
On 11/20/08, Matthew Paul Del Buono <email@example.com> wrote:
> Hi list,
> I see that it should be executing the line "return (h(op1, op2))" but that's not what I seem to get in response. I would expect "true" to be the result if the manual stated "return not not (h(op1, op2))" but it doesn't.
> Is this a manual problem, a Lua problem, or am I missing something?
Apparently, the manual and the actual Lua implementation do differ.
In the function "luaV_equalval" defined in "lvm.c" the last two line are
callTMres(L, L->top, tm, t1, t2); /* call TM */
that essentially mean "return not not (h(op1, op2))" as you correctly guessed.
It is different from the pseudo-code in the manual. I would suggest to
correct the manual.