lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: lua comma operator
From
: Egor Skriptunoff <egor.skriptunoff@
...
>
Date
: Sun, 11 Feb 2018 19:01:47 +0300
On Sun, Feb 11, 2018 at 4:55 PM, albertmcchan
wrote:
does comma operator always process from left to right ?
It's easy to check that both vanilla Lua and LuaJIT prepare values from left to right and then assign them from right to left:
local t = setmetatable({}, {__newindex =
function(t, k, v)
print(k)
end
})
local function f(v)
print(v)
end
t.a, t.b = f("c"), f("d")
Output:
c
d
b
a
Follow-Ups
:
Re: lua comma operator
,
Egor Skriptunoff
Re: lua comma operator
,
albertmcchan
Re: lua comma operator
,
Tim Hill
References
:
lua comma operator
,
albertmcchan
Prev by Date:
require("some_dll") with a statically linked Lua 5.2.4
Next by Date:
Re: lua comma operator
Previous by thread:
Re: lua comma operator
Next by thread:
Re: lua comma operator
Index(es):
Date
Thread