Log In  

I just noticed the += shorthand doesn't work the way I expected with comma separated values.

For example:

x,y,z=1,2,3
x,y,z+=10,20,30

Sets x to 11 as expected, but y and z are set to 20 and 30 respectively, rather than 22 and 33.

Should the last line be equivalent to:

x+=10
y+=20
z+=30

?

Or is there some reason I'm missing?

P#69302 2019-10-26 06:02

it is not a generic (vars)(operator)(vars|values) statement.
so yeah, works only for assignments

P#69303 2019-10-26 07:12 ( Edited 2019-10-26 07:52)

On top of that, the += operator is not standard Lua, so it's just what zep implemented himself.

P#69304 2019-10-26 08:10

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 14:57:36 | 0.007s | Q:13