local x,y=33,44
I don't know what this format is referred to as, if anything, I couldn't find any keyword. Assigns local x=33; local y=44. Has the gimmick where the assignment of x does not affect the assignment of y, i.e.
x=50
x,y=0,x --x=0,y=50
x=0 --x=0
y=x --y=0
Great. The notation relies on the comma to separate where the first variable assignment ends and the second one begins. My confusion lies with cases with inclusion of statements like this:
local a,b=
33 --a=33 b=nil
for i=1,2 do
a+=i --a=34,b=nil --a=3,b=34
a,b=i,a --a=1,b=34 --a=2,b=3
end
The above makes sense, why does the following addition of a comma create an error though:
local a,b=
33 --a=33 b=nil
for i=1,2 do
a+=i --a=34,b=nil --a=3,b=34
a,b=i,a --a=1,b=34 --a=2,b=3
end,33
From my perspective the above should just be assigning
a= 33 --a=33 b=nil
for i=1,2 do
a+=i --a=34,b=nil --a=3,b=34
a,b=i,a --a=1,b=34 --a=2,b=3
end
b=33
Seems any addition of a comma after I toss in a condition like a loop disallows me to assign the second variable to anything other than defining it within the first? I don't understand the logic here. Are there rules illustrating why this is. I can't find the information. Lacking keywords here.