lua-users home
lua-l archive

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



There are two different operations: x+1 and 1+x
They could give different results (if x has "__add" metamethod).
But they are indistinguishable in luac output:

local x
x = x + 1
x = 1 + x

        1       [1]     VARARGPREP      0
        2       [1]     LOADNIL         0 0     ; 1 out
        3       [2]     ADDI            0 0 1
        4       [3]     ADDI            0 0 1
        5       [3]     RETURN          1 1 1   ; 0 out