hit counter

Timeline

My development logbook

Assignment Statement in Lua vs Python

Given a is an array of [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

and this bit of code

1
2
i = 3
i, a[i] = i+1, 20

In lua, a will become

1
{1, 1, 1, 20, 1, 1, 1, 1, 1, 1}

Whereas in python it will become

1
2
>>> a
[1, 1, 1, 1, 20, 1, 1, 1, 1, 1]

And it is a non-issue in erlang because it does not support mutable variable